Gossamer Forum
Quote Reply
tite_linked
How can I edit <%title_linked%> or <%category_name%> or <%title%> so that I can view just the actual title of the page and not the entire category name?

I would like to edit only globals.txt and create a new sub routine if possible.

'category_title' => 'sub { $new_title =~ s,$title_linked,last category name etc...,;

I could edit sub build_title_linked in build.pm but I do not want to edit any core files...

I want to use it so that I can print just the category I am in not just Home > Magic > Magicians > Ricky Jay > Articles > Time

I would want it to just print: Time

Thanks... any help is appreciated,

- Jonathan

Last edited by:

jdgamble: Aug 17, 2004, 9:37 PM
Quote Reply
Re: [jdgamble] tite_linked In reply to
Hi,

There's no need to edit anything. Just replace the <%title_linked%> with <%category_short%>.
That's all.

Cheers,

Cheers,

Dat

Programming and creating plugins and templates
Blog
Quote Reply
Re: [tandat] tite_linked In reply to
Okay, that solves one easy problem... however I would like to use something like that subroutine to change

: to >

so instead of Home : Directories : Other Subcategories
it would be Home > Directories > Other Subcategories

Here is what I have...

'title_linked2' => 'sub {
my $title_linked = the part that grabs the title_linked routine...

$title_linked =~ s,:,>,;
return $title_linked;
}',

As you can see I'm not sure how to call the sub routine from build.pm...

Thanks,

- Jonathan
Quote Reply
Re: [jdgamble] tite_linked In reply to
Hi. This should do what you want :)

http://www.gossamer-threads.com/...i?post=271142#271142

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!
Quote Reply
Re: [Andy] tite_linked In reply to
I had tried that and it didn't work...

(for the sake of noting it... here is the code I used)

<%new_title($title_links)%> in my category...

new_title

Code:

sub {
my $in = $_[0];
$in =~ s|\:|&gt;|g;
return $in;
}



Is there not a way to call build_title_linked from build.pm and set that to a variable?

Also, the What's Cool, What's New, and Search Results pages would still display the : and no the >...

Anyway, thanks for any help once again Andy and anyone else who can,

- Jonathan
Quote Reply
Re: [jdgamble] tite_linked In reply to
$title_links

should be

$title_linked

:)

Quote:
Also, the What's Cool, What's New, and Search Results pages would still display the : and no the >...

Yeah.

There is an option somewhere (I think its in "Build >User Language" somewhere, but I can't for the life of me find it).

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!
Quote Reply
Re: [Andy] tite_linked In reply to
Duhhhhh... Everything I want to do that is so complicated is always shown to have the easiest method...


Well I see these options:

build_search_gb
build_cool_gb
build_new_gb

And in user_language I see the LINKS_TOP (set to Home)... as the closest related thing...

(I swear I checked everything)....

I can't seem to find the sub routine in one of the pm files to double check either... hmmm...



- Jonathan
Quote Reply
Re: [jdgamble] tite_linked In reply to
I found a way... here is how to change the ":" to the ">" in all pages

Code:

'new_link_results' => 'sub {
my $in = shift;
my $results = $in->{link_results};
$results =~ s,<p>(.*),<p><font face=verdana size=2><b>$1</b></font>,g;
$results =~ s, : , &gt ,g;
return $results;
}',
'new_category' => 'sub {
my $in = shift;
my $category = $in->{category_results};
$category =~ s, : , &gt ,g;
return $category;
}',
'new_title' => 'sub {
my $in = shift;
my $title = $in->{title_linked};
$title =~ s,(</a> : )[\w|\s]+,$1,;
$title =~ s, : , &gt ,g;
return $title;


<%new_link_results%> should be put in what's new and what's cool
<%new_category%> should be put in search results page
<%new_title%> should replace title_linked in the category pages

Although I have my own settings in these codes, it should be able to be easily modfied to fit your needs.

Hope someone can now sleep better,

- Jonathan