Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

modifying output of <%category_name%>

Quote Reply
modifying output of <%category_name%>
I currently have a directory setup so the Category templates display the following in the title tag:

<title><%category_name%> - <%site_title%></title>

I'm wondering how to modify the output of the <%category_name%> tag such that it prints out cats and subcats separated by a dash (-) instead of a slash (/)

Forexample it currently looks like this:

Category1/Subcat1/Subcat1a - Site Title

Whereas I'd like to have it look like:

Category1 - Subcat1 - Subcat1a - Site Title

Thanks :)
Quote Reply
Re: [codetrance] modifying output of <%category_name%> In reply to
Try creating a new global, say we call it change_title .... give it the following codes;

Code:
sub {

my $in = shift;
$in =~ s,/, - ,g;
return $in;

}

Then, for example, call you title with;

<title><%change_title($category_name)%> - <%site_title%></title>

Hope that works Smile

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!