Help - Search - Members - Calendar
Full Version: Display Category Links Under A Parent Category
Movable Type Community Forum > Using Movable Type > Entries and Archives
deanloh
I have used MTLookup and scanned through hundreds of results still I failed to find what I'm looking for. If any of you have implemented this before, please share your technique.

I have a structure like this:

Hyperlinks
-- Personal
---- Books
---- Websites
---- Blogs
---- and the list goes on
-- Professional
---- Account Management
---- Project Management
---- Design
---- and the list goes on

Now I need MT to generate the list of category links under Personal only (Books, Websites etc) and output it to this:

CODE
<ul>
<li><a href="<books category archive>">Books</li>
<li><a href="<website category archive>">Website</li>
<li><a href="<blogs category archive>">Blogs</li>
<li>... and the list goes on
</ul>


I have tried MTFilterCategories plugin, problem is, I had to specify what categories to be included, which can be troublesome as I'll have to edit the code whenever I add new subcategories in future, same goes with the exclude function.

I'm just wondering: isn't there a way to make MT generate the list of subcategories under a specific main category only?

In short, I wish the following codes...

CODE
<ul>
 <MTCategories show_empty="1">
  <li><a href="<$MTCategoryArchiveLink$>">
  <$MTCategoryLabel$></a> (<$MTCategoryCount$>)</li>
 </MTCategories>
</ul>


can become this:

CODE
<ul>
 <MTCategories show_empty="1" category="Personal">
  <li><a href="<$MTCategoryArchiveLink$>">
  <$MTCategoryLabel$></a> (<$MTCategoryCount$>)</li>
 </MTCategories>
</ul>


Help?
telemark
Does this do it?
CODE
<MTSubCategories>
 <MTIfIsDescendant parent="Personal">
   <a href="<MTCategoryArchiveLink>"><MTCategoryLabel></a>
 </MTIfIsDescendant>
</MTSubcategories>

I must confess to not having tested this so would be interested in your feedback!
deanloh
Thank you for the reply, telemark

I tried your code, no luck, it output only the archive link of "Personal"

But I still appreciate your attempt to help.
deanloh
Inspired by telemark's suggestion, I tried this:

CODE
<ul>
<MTCategories show_empty="1">
<MTIfIsDescendant parent="Personal">
  <li><a href="<MTCategoryArchiveLink>"><MTCategoryLabel></a></li>
</MTIfIsDescendant>
</MTCategories>
</ul>


It worked!!! WHOA! At last! Thanks to telemark!!! biggrin.gif
azemat
QUOTE (deanloh @ Oct 8 2005, 01:38 PM)
Inspired by telemark's suggestion, I tried this:

CODE
<ul>
<MTCategories show_empty="1">
<MTIfIsDescendant parent="Personal">
  <li><a href="<MTCategoryArchiveLink>"><MTCategoryLabel></a></li>
</MTIfIsDescendant>
</MTCategories>
</ul>


It worked!!! WHOA! At last! Thanks to telemark!!! biggrin.gif

Very very very very very very very very very Thansk!!!!!
kelake
QUOTE (azemat @ Oct 12 2005, 06:38 AM)
QUOTE (deanloh @ Oct 8 2005, 01:38 PM)
Inspired by telemark's suggestion, I tried this:

CODE
<ul>
<MTCategories show_empty="1">
<MTIfIsDescendant parent="Personal">
  <li><a href="<MTCategoryArchiveLink>"><MTCategoryLabel></a></li>
</MTIfIsDescendant>
</MTCategories>
</ul>


It worked!!! WHOA! At last! Thanks to telemark!!! biggrin.gif

Very very very very very very very very very Thansk!!!!!
*



How to make it shows only the categories for that particular entry?
pletch
THANK YOU VERY MUCH!!!

SO helpful, I've been trying to figure this out for 2 days!!! Awesome, thanks!
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-2008 Invision Power Services, Inc.