Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

How to Change Linked Title Bar

Quote Reply
How to Change Linked Title Bar
I am working on my templates, and I want to change what <%title_linked%> displays. Normally it says "Top:Category:Subcategory"

I want to remove the "top" link from it, so it will just display :Category: Subcategory.

Where can I change this?

Thanks,
Amanda
Quote Reply
Re: How to Change Linked Title Bar In reply to
there are a few.. look in DB_Utils.pm for the main one that appears on the category pages..

sub build_linked_title

then there is one in search.cgi

sub search_build_linked_title

there might be more.. maybe one for new and cool pages..

hint on how to edit them...

look for lines that start with $output..

those are the lines that have the content..

edit things between the "|"s...

in search.cgi..

Code:
$output .= qq| <A HREF="$LINKS{build_root_url}$path/">$dirs[$_]</A> :|;

the colon at the end.. if you change that to more than one character.. you are going to want to add.. however many new characters you added of

Code:
chop $output;

on the line below that already has one chop $output;..

in DB_Utils.pm..

Code:
$output .= " $last";

displays the category you're in.. (no link).

jerry
Quote Reply
Re: How to Change Linked Title Bar In reply to
Sounds like a good place for a revision Wink Any time you need to change several subs to do the same thing, means the code should probably be pulled out into it's own function, or the function rewritten....

I've cursed this a few times over the generations myself. Maybe Alex can pull it all together and expand the parent function to include the entire location bar.

This would also allow replacement of that function with other forms of location, simply by replacing one sub routine, rather than making changes to the source.

(I'm against source changes because it makes upgrades very difficult -- so where things can become a function, parameter or flag, they need to. It's much easier to paste in your custom version of a function, than to make tweaky changes or hacks to the source in a dozen places.)



------------------
POSTCARDS.COM -- Everything Postcards on the Internet www.postcards.com
LinkSQL FAQ: www.postcards.com/FAQ/LinkSQL/







Quote Reply
Re: How to Change Linked Title Bar In reply to
you could differentiate them by doing like this..

Code:
sub build_linked_title {
# --------------------------------------------------------
# Returns a string of the current category broken up
# by section, with each part linked to the respective section.

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

@dirs = split (/\//, $input);
$search or $last = pop @dirs;
$output = qq| <A HREF="$LINKS{build_root_url}/$LINKS{build_index}">Top</A> :|;
for (0 .. $#dirs) {
$path = "/" . &build_clean_name( join "/", @dirs[0 .. $_] );
$output .= qq| <A HREF="$LINKS{build_root_url}$path/$LINKS{build_index}">$dirs[$_]</A> :|;
}
$search ? (chop $output) : ($output .= " $last");
return $output;
}

in search.cgi just use

&build_title_linked ($input, 1);

jerry
Quote Reply
Re: How to Change Linked Title Bar In reply to
If we add that to the HTML_Templates.pm file, and make sure it's in the %tags hash, it would then be available to all the templates as well, including the .cgi programs.

You wouldn't have to edit anything, just make sure to add that routine to the HTML_Templates.pm file for each revision.

I'm still hoping Alex will work in a CUSTOM.pm file, where local subroutines and customizations can be placed, and then included, which will prevent lots of edits down the road Smile

The reason is that it's clumsy enough to paste the user/local variables into the top of the HTML_Templates.pm file each time, to make changes throughout the program as the program gets larger will be more difficult, so that a CUSTOM.pm file and such will be much more important over time.

Quote Reply
Re: How to Change Linked Title Bar In reply to
i split my HTML_Templates.pm into two files Smile

HTML_Templates.pm and CGI_Templates.pm

cause it was getting really big.. with all the templates.. now it's easier to find stuff..

except i have to use both of them in page.cgi.. cause it uses things from both Smile

jerry