user-pic

Find an entry's parent category if it's not explicitly assigned

Vote 0 Votes

In the context of an entry archive, if an entry has a subcategory as its primary category, but is not explicitly assigned to that subcat's parent category, how can I get the label of that parent? I figured it out for the category archive itself, but have hit a wall on the entry archive.

I'm using top-level categories as the main nav, so want to use the top-level category basename to set the active state in the nav, but would like to avoid requiring the authors to set the top level category, if possible.

1 Reply

| Add a Reply
  • Try something like this inside mt:EntryCategories for the entry: <mt:HasParentCategory><mt:ParentCategory>Do stuff here</mt:ParentCategory></mt:HasParentCategory>

Add a Reply

Forum Groups

151 405

Last Topic: MT Interface Missing by Sherri on Nov 10, 2008

36 144

Last Topic: Installation can't finish by Drazend on Nov 10, 2008

34 93

Last Topic: Creating your own Plug-in by jondauz on Nov 5, 2008

10 33

Last Topic: new licensing confusion by Neil Epstein on Aug 14, 2008

code.sixapart.com

62 226

Last Topic: Callback after blog publishing. by Tomato Interactive on Oct 27, 2008

34 98

Last Topic: Ajax Rating Plugin by kiran on Oct 17, 2008