Help - Search - Members - Calendar
Full Version: Subcategories Without Top-level Category?
Movable Type Community Forum > Using Movable Type > Categories and Entry Tags
hass
When selecting the categories of an entry, what happens if I click on a subcategory but not on its parent category?

In other words suppose I have a toplevel category of C which has subcategories C1, C2, and C3.

If I categorize an entry under C3, but NOT under parentcategory C, is C3 treated as a parent category itself?

Also, how would I list the subcategory of the particular category in which an entry is filed, ie:

"This Entry is filed under (Parent Category) and (Subcategory)"



iki
QUOTE (hass @ Apr 25 2008, 01:27 PM) *
When selecting the categories of an entry, what happens if I click on a subcategory but not on its parent category?

In other words suppose I have a toplevel category of C which has subcategories C1, C2, and C3.

If I categorize an entry under C3, but NOT under parentcategory C, is C3 treated as a parent category itself?


By choosing subcategory C3, you've already selected parentcategory C. You don't have to explicitly choose both. A child category automatically belongs to its parent. Subcategories (child categories) are never treated as parents.


QUOTE
Also, how would I list the subcategory of the particular category in which an entry is filed, ie:

"This Entry is filed under (Parent Category) and (Subcategory)"


The code to do what you want is:

CODE
This entry is filed under <MTHasParentCategory><MTParentCategory><$MTCategoryLabel$></MTParentCategory> and <$MTCategoryLabel$>.<MTElse><$MTCategoryLabel$>.</MTElse></MTHasParentCategory>


That code ensures that the order is "parent : child". In the event you file under a parent cat with and not a subcat, it will just show the parent cat. You can see a sample here.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.