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

Listing category on detailed pages

Quote Reply
Listing category on detailed pages
Hi -

I plan to run category-specific SSIs on my "detailed view" pages, and would like a way to insert the (unlinked) base category name (ie: Desserts vs Desserts/Cookies) into the code where appropriate, in much the same way I call <%Description%> and other variables.

For some reason, what works on the category page (<%category_name%>) does not work on the detailed view. I have not been able to find out how to do this (have checked forums, faqs and looked through the code as much as I could - but I'm not super perl savvy). Basically, I just need a way to call the Category name on the completed detailed pages.

If anyone has ideas, they would be much appreciated. Thanks so much!

Quote Reply
Re: Listing category on detailed pages In reply to
Hi,

depending how you build your detailed pages you need to modify the code of:

1. If static: nph-build.cgi
find the sub build_detailed_view {

change:

print DETAIL &site_html_detailed ($link, { grand_total => $GRAND_TOTAL, title_linked => $title_linked });

to :

print DETAIL &site_html_detailed ($link, { grand_total => $GRAND_TOTAL, title_linked => $title_linked, cat_title => $category->{'Name'} });

now you can use the <%cat_title%> tag in your detailed pages

2. if dynamic : page.cgi
find: sub generate_detailed_page {

change:

print &site_html_detailed ($link, { grand_total => $GRAND_TOTAL, title_linked => $title_linked}, $in);

to:

print &site_html_detailed ($link, { grand_total => $GRAND_TOTAL, title_linked => $title_linked, cat_title => $category->{'Name'} }, $in);

hope it helps,
regards alexander

Quote Reply
Re: Listing category on detailed pages In reply to
Thank you! This worked perfectly - it was exactly what I was looking for.

I really appreciate your help!