Gossamer Forum
Home : Products : Links 2.0 : Discussions :

Changing text for title_linked

Quote Reply
Changing text for title_linked
I'd like to change the output for the %title_linked% field from "Top : category name" to "index - category name". Where is this change made?

Thanks!
Roger

~~~~~~~~~~~~~
http://theastropages.com/
http://astronomylinks.com/
http://diegotek.com/
Quote Reply
Re: Changing text for title_linked In reply to
it's in nph-build.cgi, sub build_linked_title.

--Drew
Quote Reply
Re: Changing text for title_linked In reply to
OK, on the same idea, how can I change the : to - when you display categories and sub-categories using the <%category_clean%>? I looked high and low and didn't see it anywhere. For example, it now says "telescopes : specific models" and I want "telescopes - specific models". Thanks!

Roger

~~~~~~~~~~~~~
http://theastropages.com/
http://astronomylinks.com/
http://diegotek.com/
Quote Reply
Re: Changing text for title_linked In reply to
In sub build_linked_title in nph-build.cgi as already stated. Only eleven lines of code so it shouldn't be too hard to find! Mad

Martin Webster
--
Cebidae's UK Internet Resource
http://www.cebidae.co.uk/
Quote Reply
Re: Changing text for title_linked In reply to
OK, here's that sub as I have it now:

# Returns a string of the current category broken up
# by section, with each part linked to the respective section.

my $input = shift;
my (@dirs, $dir, $output, $path, $last);

@dirs = split (/\//, $input);
$last = &build_clean(pop @dirs);

$output = qq| <A HREF="$build_root_url/">index</A> >|;
foreach $dir (@dirs) {
$path .= "/$dir";
$dir = &build_clean ($dir);
$output .= qq| <A HREF="$build_root_url$path/">$dir</A> >|;
}
$output .= " $last";

return $output;

I changed the parts I could find for the %title_linked% i noted before (the : to >), but it's having no effect on <%category_clean%>. In that situation is still displays a colon rather than a dash as noted. What am I missing in this sub? You can see an example at:

http://astronomylinks.com/pages/telescopes/specific_models/

The text in question is in the blue box there and says "telescopes : specific models" as does my title. It's probably important to note that this is a sub-category, not the main category, so maybe that's why it's not in this sub, AFAIK.

Clear skies,
Roger

~~~~~~~~~~~~~
http://theastropages.com/
http://astronomylinks.com/
http://diegotek.com/
Quote Reply
Re: Changing text for title_linked In reply to
right under build_linked_title is build_unlinked_title.

--Drew
Quote Reply
Re: Changing text for title_linked In reply to
Thanks for the note Drew. Here's the original build_unlinked_title sub:

sub build_unlinked_title {
# --------------------------------------------------------
# Returns a string of the current category broken up by section.
# Useful for printing in the title.

my $input = shift;
my (@dirs, $dir, $output);

@dirs = split (/\//, $input);

foreach $dir (@dirs) {
$dir = &build_clean ($dir);
$output .= " $dir:";
}
chop ($output);
return $output;
}

I changed that : to - in [$output .= " $dir:";] and then rebuilt. It made no difference. It still show's the :, not the - I put in instead. Any more thoughts? Maybe I need to format it like the output from build_linked_title. I tried it a little without result.

Thanks for the assist,
Roger

~~~~~~~~~~~~~
http://theastropages.com/
http://astronomylinks.com/
http://diegotek.com/
Quote Reply
Re: Changing text for title_linked In reply to
Okay...I cannot resist...The advice provided so far is not correct...And don't think that I am coming back to the Links 2.0 Forums...because I ain't. Tongue

The <%category_clean%> tag is generated from the $category_clean variable in the sub build_category_pages in the nph-build.cgi file, which uses the &build_clean sub to build the clean category name.

What you need to do is add the following subroutine in your db_utils.pl file:

Code:

sub build_clean_category {
# --------------------------------------------------------
# Formats clean category name
#
my ($input) = shift;
$input =~ s/_/ /g; # Change '_' to spaces.
$input =~ s,/, - ,g; # Change '/' to ' - '.
return $input;
}


as not to screw up your other category name layouts if you want to keep the : in other spots in your web site.

Then edit the following codes in the sub build_category_pages routine:

Code:

$category_clean = &build_clean ($cat);


with the following codes:

Code:

$category_clean = &build_clean_category ($cat);


Then re-build your index.

Regards,

Eliot Lee

Quote Reply
Re: Changing text for title_linked In reply to
I think sub build_clean in db_utils.pl needs changing too:

$input =~ s,/, : ,g; # Change '/' to ':'.

Martin Webster
--
Cebidae's UK Internet Resource
http://www.cebidae.co.uk/
Quote Reply
Re: Changing text for title_linked In reply to
Oh... I tried Blush

--Drew
Quote Reply
Re: Changing text for title_linked In reply to
Uh...NO...it doesn't...Look at the codes I've posted...I have already suggested adding another sub LIKE sub build_clean that will do what this user wants for the <%category_clean%>.

Regards,

Eliot Lee

Quote Reply
Re: Changing text for title_linked In reply to
We surely miss your input though Eliot. Smile

Martin Webster
--
Cebidae's UK Internet Resource
http://www.cebidae.co.uk/
Quote Reply
Re: Changing text for title_linked In reply to
That worked perfectly - but you knew that already Smile

Thanks!
Roger

~~~~~~~~~~~~~
http://theastropages.com/
http://astronomylinks.com/
http://diegotek.com/
Quote Reply
Re: [Cebidae] Changing text for title_linked In reply to
In Reply To:
I think sub build_clean in db_utils.pl needs changing too:

$input =~ s,/, : ,g; # Change '/' to ':'.

Martin Webster
--
Cebidae's UK Internet Resource
http://www.cebidae.co.uk/


Hello,

Can you help me find this file? Also, will this change the / in the title to a : ? Thank you so much for you help.



Kato
Quote Reply
Re: [Stealth] Changing text for title_linked In reply to
Do you know how I can change the / in my title to a :



Thanks

Kato
Quote Reply
Re: [kato] Changing text for title_linked In reply to
Look right over here, post number four...


Leonard
aka PerlFlunkie