Gossamer Forum
Quote Reply
catid
Hi,

I've had a good search of posts but nothing hits the nail on the head with this one, most relate to the top 5 plugin which I don't use.

In my search results page I made a header and thanks to afinlr I have got the search ok but on the right I want to display <%title%> or <%title_linked%>

I can display <%catid%> ok but the number is a bit meaningless, how can I translate this to the category?, as <%title_linked%> or <%title%> just come back with errors (not defined etc)

I tried a couple of posted globals but they threw it entirely. Did a GT Dump but that didn't shed any light on it. If I can get ID can I get the name or is this a lost cause?

thanks in advance

Kevin

Cheers
KevM
Quote Reply
Re: [KevM] catid In reply to
Should be able to use;

<%get_cat_name($catid)%>

Code:
sub {

my $ID = $_[0];
my $name = $DB->table('Category')->select( ['Full_Name'], { ID => $ID } )->fetchrow;
$name ? return $name : return 'Cant find category name!';

}

Untested, but it should work :)

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] catid In reply to
Thanks Andy, works a treat.

Cool

Cheers
KevM