MT 3.1 Subcategories

Movable Type 3.1 lets you now have subcategories, something that I'd kind of been wanting for a while. I'm currently using them and you can see some of the groupings of categories I have to the right. The code is after the 'more' link.

<h3>Categories</h3>
  <div class="right-text">
  <MTSubCategories>
  <MTSubCatIsFirst><ul <MTHasNoParentCategory>class="open parent"</MTHasNoParentCategory>     <MTHasParentCategory>id="ul_item<MTParentCategory>
    <$MTCategoryID$></MTParentCategory>" class="closed"</MTHasParentCategory>>     </MTSubCatIsFirst>

  <li
  <MTHasNoParentCategory> id="item<$MTCategoryID$>"</MTHasNoParentCategory>
  <MTHasParentCategory> id="item<MTParentCategory><$MTCategoryID$></MTParentCategory>
    _<$MTCategoryID$></MTHasParentCategory>">
    <MTHasSubCategories>[<a onclick="toggle('item<$MTCategoryID$>');">+</a>]
    </MTHasSubCategories>
  <MTHasNoSubCategories><MTHasNoParentCategory>[+]</MTHasNoParentCategory>
    </MTHasNoSubCategories>
  <a href="<MTCategoryArchiveLink>"><MTCategoryLabel> (<MTCategoryCount>)</a>
  <MTSubCatsRecurse>
  </li>
  <MTSubCatIsLast></ul></MTSubCatIsLast>
  </MTSubCategories>
</div>

If you view the source for this page you can see what it creates (along with the javascript it runs). There is documentation for this as part of the MT 3.1 documentation (also viewable here). If you are looking for other examples of the subcategories, you could start by checking out David Raynes' SubCategories, since the Movable Type 3.1 subcategories are based on his plugin. (Of course in the midst of typing this I realized I'd been talking to David earlier today on #joiito. Small world!)

Pages

Powered by Movable Type 8.0.2

About this Entry

This page contains a single entry by Gregory published on August 31, 2004 7:30 PM.

Movable Type 3.1 Released was the previous entry in this blog.

QOTD 09/01/2004 is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.