Ordering Categories (a hack)

| 2 Comments

One feature I’d like to add is the ability to order categories via some drag-n-drop method in Movable Type and then have the ability to specify the sort order manually via a sort_by template tag modifier like this:

<mt:Categories sort_by="manual">
    <!-- category code here -->
</mt:Categories>

Or just make this the default behavior!

Until then, here’s a hack to sort by a user-order specified.

  1. Go to the Edit Categories screen.
  2. Using the “open link in new tab” option (right-click or command-click), click each category to open them in new tabs in the order that you want them in.
  3. Just before the text of the label, add an html comment and place a number in the comment. Make each html comment identical to ensure sorting works properly. Because the number is in an HTML comment, it won’t be displayed on your site, but the sorting will be correct!

hack-category-order.jpg

2 Comments

Thanks for this quick and easy hack. I was looking around for a while before I stumbled across your solution. Cheers!

Yup…totally awesome advice. Thanks for that tidbit!!

Leave a comment