Not a developer? Go to MovableType.com

Plugin and Theme Directory

Categories by Date v1.0.1

By Dan Wolfgang
Posted February 11, 2010, in MT Tags, Templates, Widgets.

Details

Overview

Categories are not a date-related object in MT, so publishing categories in a date-structured way isn’t possible.

The CategoriesByDate plugin adds a block tag that will sort categories by date, with the most recently updated first. To determine the order of the categories, each category is compared to newest entry it is used in and that entry’s date sorts the category.

Use

This plugin adds the <mt:CategoriesByDate>...</mt:CategoriesByDate> block tag, which creates a category context. The following is a simple example of its use, and will return an unordered list of categories sorted by the date of their last use.

<mt:CategoriesByDate>
    <mt:If name="__first__">
    <ul>
    </mt:If>
        <li><mt:CategoryLabel></li>
    <mt:If name="__last__">
    </ul>
    </mt:If>
</mt:CategoriesByDate>

CategoriesByDate can also take a few arguments to help you refine the tag’s results:

  • The top argument can be set to a value of 1. This will return only the top-level categories.
  • The include_children argument can be set to a value of 1. This will cause the current category’s subcategories and their contents to be considered when determining the current category’s date.
  • The limit argument can be set to a positive number to limit the number of results returned, making it easy to create a list of the five recently-active categories, for example.

Below is an example that makes use of all of these arguments. Only the top-level categories are returned, but all subcategories are considered when determining the order of the top-level categories. Only the first 5 categories are returned. A link to the newest entry in that category is also published.

<mt:CategoriesByDate top="1" include_children="1" limit="5">
    <mt:If name="__first__">
    <ul>
    </mt:If>
        <li>
            <span class="category"><a href="<mt:CategoryArchiveLink>"><mt:CategoryLabel></a></span>:
            <mt:CategoryLabel setvar="current_category">
            <span class="entry"><mt:Entries category="$current_category" lastn="1"><a href="<mt:EntryPermalink>"><mt:EntryTitle></a></mt:Entries></span>
        </li>
    <mt:If name="__last__">
    </ul>
    </mt:If>
</mt:CategoriesByDate>

Acknowledgements

This plugin was commissioned by The Roster, a web marketing and design team, to Dan Wolfgang of uiNNOVATIONS.

Compatibility

Movable Type versions: 4.35.0

License

Perl Artistic


Back

26 Comments

Rahul Sharma

Rahul Sharma on September 2, 2016, 9:18 a.m. Reply

Happy New Year 2017 images Get Happy New Year 2017 Wishes Quotes thoughts Messages Images wallpaper. All SMS are handpicked and best short simple.

Merry Christmas 2016 sayings

Eliza Gallagher

Eliza Gallagher on May 24, 2017, 8:31 p.m. Reply

Great addition to my MT install. I love keeping things organized, and this was one of the pet peeves that I had for a while. I wish I would have found it sooner, guess I was Snow Blind. :) Great work, thanks for sharing!

jatin

jatin on January 20, 2018, 9:15 a.m. Reply

get the exact information here for free how to open internet explorer in windows 10

JOHN

JOHN on February 25, 2018, 6:15 p.m. Reply

get the exact information here for free solarmovies solarmovie

tom curran

tom curran on May 2, 2018, 10:59 a.m. Reply

Whirlpool Destroyer is the top non-electric water purifier in India. We compare best water purifier for home use and list the top 10 best water purifiers.

stergue

stergue on June 13, 2018, 2:16 p.m. Reply

Actually this is one of the most exciting articles. cb01 hd streaming

Jacky888

Jacky888 on July 26, 2018, 11:04 a.m. Reply

download firmware for printer http://gofirmware.com/article/download-firmware-for-printer pdn 626b firmware update gofirmware psp3468duo root bestandroidtoroot.

johnb6174

johnb6174 on August 11, 2018, 8:06 a.m. Reply

The post is written in very a good manner and it contains many useful information for me. thewellnesstemple.ca

john

john on August 11, 2018, 5:01 p.m. Reply

Excellent information on your blog, thank you for taking the time to share with us. Amazing insight you have on this, it’s nice to find a website that details so much information about different artists. Online quran classes

johnb6174

johnb6174 on August 12, 2018, 4:24 p.m. Reply

I high appreciate this post. It’s hard to find the good from the bad sometimes, but I think you’ve nailed it! would you mind updating your blog with more information? techinexpert

john

john on August 13, 2018, 4:06 p.m. Reply

I high appreciate this post. It’s hard to find the good from the bad sometimes, but I think you’ve nailed it! would you mind updating your blog with more information? edwardsragatz.com

johnb6174

johnb6174 on August 19, 2018, 8:44 a.m. Reply

Thank you for such a well written article. It’s full of insightful information and entertaining descriptions. Your point of view is the best among many. justcannabis.ca

johnb6174

johnb6174 on August 19, 2018, 5:09 p.m. Reply

I really appreciate this wonderful post that you have provided for us. I assure this would be beneficial for most of the people. healingempire.ca

johnb6174

johnb6174 on August 20, 2018, 4:08 p.m. Reply

Thanks for taking the time to discuss that, I feel strongly about this and so really like getting to know more on this kind of field. Do you mind updating your blog post with additional insight? It should be really useful for all of us. 925 sterling sliver bracelet

johnb6174

johnb6174 on August 21, 2018, 1:21 p.m. Reply

I really appreciate the kind of topics you post here. Thanks for sharing us a great information that is actually helpful. Good day! Social Security Disability

fleya

fleya on August 24, 2018, 4:32 p.m. Reply

This is a very good post. Thanks for your efforts. https://www.123moviesfree.ws

fleya

fleya on August 24, 2018, 4:36 p.m. Reply

This is a very good post. Thanks for your efforts. https://www.123moviesfree.ws

john

john on August 26, 2018, 3:40 p.m. Reply

I admit, I have not been on this web page in a long time… however it was another joy to see It is such an important topic and ignored by so many, even professionals. professionals. I thank you to help making people more aware of possible issues. Complete Access Business TV

johnb6174

johnb6174 on August 27, 2018, 2:20 p.m. Reply

This blog is so nice to me. I will keep on coming here again and again. Visit my link as well.. projecteagle.ca

johnb6174

johnb6174 on August 28, 2018, 6:02 p.m. Reply

Excellent information on your blog, thank you for taking the time to share with us. Amazing insight you have on this, it’s nice to find a website that details so much information about different artists. Tile Cleaning

johnb6174

johnb6174 on August 29, 2018, 3:04 p.m. Reply

I really enjoyed reading this post, big fan. Keep up the good work and please tell me when can you publish more articles or where can I read more on the subject? Plumber

johnb6174

johnb6174 on August 30, 2018, 2:41 p.m. Reply

This is really a nice and informative, containing all information and also has a great impact on the new technology. Thanks for sharing it divorce paralegal near me

JOHN

JOHN on September 5, 2018, 10:31 a.m. Reply

This is really a nice and informative, containing all information and also has a great impact on the new technology Gomovies

johnb6174

johnb6174 on September 9, 2018, 11:11 a.m. Reply

It is imperative that we read blog post very carefully. I am already done it and find that this post is really amazing. Funeral Venue Bournemouth

johnb6174

johnb6174 on September 19, 2018, 4:43 p.m. Reply

This is really a nice and informative, containing all information and also has a great impact on the new technology. Thanks for sharing it hearing

Riya

Riya on October 11, 2018, 6:49 a.m. Reply

The CategoriesByDate plugin gives a block tag that will sort categories by date, with the most recently updated first. It makes easy to determine the order of the categories. Here the whole details about this plugin are shared and thanks for this article. Epson Printer Troubleshooting

Leave a Comment

Dan Wolfgang

Dan is an engineering creative and uses his vast knowledge of the web to solve unique client problems with specialized solutions. Complex or straightforward, his focus is to find the most efficient, functional, elegant, and stable solutions for each project. 10 years in web engineering and 14 more in the print publishing industry give him a special insight to the needs, restrictions, and workflows of content publishers, both traditional and new media. Dan is an active Movable Type community member who has written and contributed to countless plugins including some of the most popular: More Custom Fields, Poll Position, and Asset Image Quality.

Website: http://uinnovations.com
Twitter: @danwolfgang