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

Display linked Category/Sub-Category Name

Quote Reply
Display linked Category/Sub-Category Name
I want a global that accepts category id as an input, and returns back the category name only:

Something like this:

<%show_cat('444')%>

where 444 = category id of specific category.
The output for the above is:

Nissan Pathfinder

linked cat/subcat name from CARS > Japaniese > Nissan > Nissan Pathfinder

Thank you much..
Mark
Quote Reply
Re: [Mark2] Display linked Category/Sub-Category Name In reply to
In Reply To:
I want a global that accepts category id as an input, and returns back the category name only:

Something like this:

<%show_cat('444')%>

where 444 = category id of specific category.
The output for the above is:

Nissan Pathfinder

linked cat/subcat name from CARS > Japaniese > Nissan > Nissan Pathfinder

Thank you much..
Mark


Any answer, as I've really still waiting for it for more than a month....this is my third posting for the same thread.???
Thanks
Mark
Quote Reply
Re: [Mark2] Display linked Category/Sub-Category Name In reply to
Please remember that the forums aren't a guaranteed source for free custom work. A lot of the users are kind enough to help out with people's code requests, but this is voluntary. That said, I believe what you want can be done in a simple global - something like this:
Code:
sub {
my $cat_id = shift;
return $DB->table('Category')->select('Name', { ID => $cat_id })->fetchrow;
}

Adrian
Quote Reply
Re: [brewt] Display linked Category/Sub-Category Name In reply to
Thanks Adrian for your help. I understand your point, and you are right on this issue; however, the forum at GT used to be a lot more active that it is now a days, as many posts they go unanswered unlike before..
Regrading this code, this is exactly what I am looking for, and I will give it a try, I hope I can construct the calling function (like pass the cat id)....
Best regards.. and thanks..
Mark