Show parent categories

Skinning and designing Serendipity (CSS, HTML, Smarty)
Post Reply
User avatar
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Show parent categories

Post by yellowled » Mon Jan 16, 2006 2:44 pm

Hi everyone,

I'm currently trying to make my template display not only the "child" category an entry belongs to but also the "parent" category - if that's possible in s9y at all?

My problem is to find the right (smarty?) variable to use for this. My "target" would be something like:
Written by YL in <child cat> (<parent cat>) ...

below any given entry.

Could someone please point me to the correct variable or tell me this isn't possible at all before I get mad browsing code I only partially understand? :wink:

Thanks in advance,
YL

User avatar
garvinhicking
Core Developer
Posts: 30020
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Show parent categories

Post by garvinhicking » Mon Jan 16, 2006 3:02 pm

This is not possible by default. You will need to perform additional DB queries to get the category parents, which is both not easy to do, and also not very performant.

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/

Post Reply