Gossamer Forum
Home : Products : Links 2.0 : Customization :

pulling top level category in detailed pages.

Quote Reply
pulling top level category in detailed pages.
Hello all,

I was wondering if there was a way to pull the top level category name and add it into my detailed page? Here is an example of what i want to do...

i am trying to set up a product database and my top level category is a manufacturer. When the detailed page is made I have it listing description, price, etc. I would like to list the manufacturer in there too, without adding another field to the database.

Thanks,
Ian
Quote Reply
Re: pulling top level category in detailed pages. In reply to
Have you tried using:

Code:
Category: <a href="<%build_root_url%>/<%Category%>"><%Category%></a>

Regards,


------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.
Quote Reply
Re: pulling top level category in detailed pages. In reply to
Yes, that does not work because it also lists the sub-category. I need just the top level category

ie...

I have the following category, Cabletron which contains only sub categories one of which being Ethernet. So if the product is in Cabletron/Ethernet then using <%Category%> will list it as Cabletron: Ethernet where
I only want it to say Cabletron on the detailed page.

Does anyone follow? I know i can add a field to the db but I already added a few and don't really want to add more.

Thanks for any help,
Ian
Quote Reply
Re: pulling top level category in detailed pages. In reply to
Yep...I follow you...

What you will need to do in the sub site_html_link routine is create a variable called something like $category, then you will have to split the / values in the $rec{'Category'}, so that you can parse the top level category.

Best of luck.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.


[This message has been edited by AnthroRules (edited April 15, 2000).]
Quote Reply
Re: pulling top level category in detailed pages. In reply to
Thank You will give it a try...


Ian
Quote Reply
Re: pulling top level category in detailed pages. In reply to
Sorry Eliot, I tried to figue this one out on my own and I came up with nothing. Any help would be great!

Quote:
then you will have to split the / values in the $rec{'Category'}, so that you can parse the top level category

I could not find this "$rec{'Category'}"( and I am just learning perl so splitting the values is french to me Smile )

Thanks for your help,
Ian
Quote Reply
Re: pulling top level category in detailed pages. In reply to
Uh...the $rec{'Category'} is part of the codes you need to add to your site_html_detail_view...sorry for the confusion about sub-routines.

This is the field that you split and use only the first part of the field before the /. I would recommend taking a Perl tutorial or searching the perl.com site for split.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
Anthro TECH, L.L.C
anthrotech.com
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.