Show parent categories

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

Show parent categories

Post by yellowled »

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
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Show parent categories

Post by garvinhicking »

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