Not a developer? Go to MovableType.com

Plugin and Theme Directory

Order v1.2

By markpasc
Posted July 30, 2008, in Utilities.

Details

Collect sets of template output to order by a particular datum.

Installation

Unarchive into your Movable Type directory.

Usage

Use the provided template tags to collect and reorder template content. For example, to show the last 30 unique entries and ActionStreams items:

<mt:Order limit="30">

    <mt:OrderHeader>
        <div class="site-activity">
    </mt:OrderHeader>

    <mt:OrderDateHeader>
        <div id="one_day">
            <p class="date"><mt:OrderDate format="%B %e, %Y"></p>
    </mt:OrderDateHeader>

    <mt:OrderDateFooter>
        </div>
    </mt:OrderDateFooter>

    <mt:Entries lastn="30">
        <mt:OrderItem>
            <mt:setvarblock name="order_by" strip_linefeeds="1" trim="1">
                <mt:EntryDate utc="1" format="%Y%m%d%H%M%S">
            </mt:setvarblock>
            <mt:Include module="Entry">
        </mt:OrderItem>
    </mt:Entries>

    <mt:ActionStreams limit="30">
        <mt:setvarblock name="actionurl"><mt:StreamActionURL escape="html"></mt:setvarblock>
        <mt:If name="actionurl" like="mysite.com">
        <mt:Else>
            <mt:OrderItem>
                <mt:setvarblock name="order_by" strip_linefeeds="1" trim="1">
                    <$mt:StreamActionDate format="%Y%m%d%H%M%S"$>
                </mt:setvarblock>
                <p><a href="<mt:StreamActionURL escape="html">"><img src="/img/icons/<mt:var name="service_type">_16.png" width="12" height="12"></a> <a href="<mt:StreamActionURL escape="html">" class="actionlink"><mt:StreamActionTitle></a></p>
            </mt:OrderItem>
        </mt:If>
    </mt:ActionStreams>

    <mt:OrderFooter>
        </div>
    </mt:OrderFooter>

</mt:Order>

Template tags

The collection and reordering of content is governed through these provided template tags:

mt:Order

Provides the context in which content items are reordered. All the mt:OrderItem tags contained within an mt:Order tag are sorted as one set of content based on the value of their order_by variables.

mt:Order takes the following optional attributes:

sort_order

If set to ascend, reorders the content from first to last (that is, 1 to 9 and A to Z). Otherwise, the items are sorted in descending order (Z to A and 9 to 1).

offset

Specifies a number of mt:OrderItems to skip. That is, after reordering all the mt:OrderItem tags, discard this many items from the front of the list.

limit

Specifies how many mt:OrderItems to show. That is, after reordering all the mt:OrderItem tags (and discarding items due to offset), keep only this many items from the front of the list.

natural

If set to 1, sorting values that look like numbers will be sorted numerically. Otherwise, items are sorted “asciibetically.”

When all your sorting values are strings of the same length that you want to compare strictly character by character, such as timestamps, omit this to save some computational work. If your content’s sorting values are user-provided or if they’re numbers, specify natural="1".

shuffle

If set to 1, reorder the items randomly instead of using the sorting values.

When using this attribute, you can safely omit the natural, sort_order, and by attributes, and you need not set sorting values inside your mt:OrderItem tags. mt:OrderItem pin attributes are still honored, however.

by

Specifies the name of the variable by which to order items. If not given, the items are sorted by the values of the default variable order_by.

If your mt:OrderItem template fragments are already storing their sorting values in a variable, you can put the name of that variable in the mt:Order by attribute to avoid copying those values into the order_by variable.

mt:OrderItem

Packages a content fragment for reordering against the sibling mt:OrderItem tags in an mt:Order.

Order items are reordered based on the value of the order_by variable you set inside the mt:OrderItem tag. Set the order_by variable by using the mt:SetVarBlock tag or the setvar="variable name" global attribute on a tag inside the mt:OrderItem.

mt:OrderItem has one optional attribute:

pin

When specified, instead of being sorted against the other items, the content of the mt:OrderItem will be inserted into the ordered set at the point you specify.

Pin points are zero-based indexes into the final set. That is, writing mt:OrderItem pin="0" is almost like using the mt:OrderHeader tag. Pin points can also be specified relative to the end of the list by using negative numbers: writing mt:OrderItem pin="-1" is almost like using the mt:OrderFooter tag.

If multiple mt:OrderItems have the same pin value, those items will be reordered based on their order_by values, then spliced into the full set of items at the specified pin point as a contiguous tranche. Pinned groups are inserted from left to right (0 to -1), so groups with multiple items may overlap with groups pinned nearby. For example, if there are four items pinned at 0 and one item pinned at 1, in the final reckoning three of the items pinned at 0 will appear after the item at 1: by the time the item at 1 is finally pinned, the other items pinned at 0 have already become items 1, 2, and 3.

Pinned items are put in position before the mt:Order tag’s limit attribute is considered. That is, if you order 11 items, pin one to -1 (last), and use limit="10" on the mt:Order tag, the pinned item will not be shown (it was the eleventh of ten items).

mt:OrderHeader

Contains template content that is displayed at the front of the mt:Order loop, as long as there are mt:OrderItems to display.

Content from an mt:OrderHeader is shown before the first mt:OrderItem, or even an mt:OrderItem pinned to the front with the pin="0" attribute.

mt:OrderFooter

Contains template content that is displayed at the end of the mt:Order loop, as long as there are mt:OrderItems to display.

Content from an mt:OrderFooter is shown after the last mt:OrderItem, even an mt:OrderItem pinned to the end with the pin="-1" attribute.

mt:OrderDateHeader

A container tag whose contents will be displayed before the mt:OrderItem in context if it is the first item for a given day. Requires order_by variable set inside the mt:OrderItem tag to be a timestamp formatted %Y%m%d%H%M%S.

mt:OrderDateFooter

A container tag whose contents will be displayed after the mt:OrderItem in context if it is the last item for a given day. Requires order_by variable set inside the mt:OrderItem tag to be a timestamp formatted %Y%m%d%H%M%S.

mt:OrderDate

A function tag that works like an mt:Date tag, for use within mt:OrderDateHeader and mt:OrderDateFooter blocks. Does not take a utc attribute.

Changes

1.2 10 October 2011

  • Added mt:OrderDateHeader and mt:OrderDateFooter tags.
  • Added mt:OrderDate tag.

1.1 10 June 2010

  • Added mt:OrderHeader and mt:OrderFooter tags.
  • Added shuffle ordering option.
  • Added pin feature.

1.0 30 July 2008

  • First release

Compatibility

Movable Type versions: 4.35.05.15.26.0 Verified

License

MIT


Back

81 Comments

Susan on October 15, 2010, 12:12 p.m. Reply

Any chance this will be upgraded for MT5?

Proud Infotech

Proud Infotech on March 21, 2016, 7:44 a.m. Reply

Awesome plug in thanks http://nextsem.in/ .. :D

seorankbuilder

seorankbuilder on December 23, 2016, 3:25 p.m. Reply

Thanks for sharing us. pheromone products for men and women

seorankbuilder

seorankbuilder on December 24, 2016, 3:28 p.m. Reply

thank you for a great post. www.vervex.info

seorankbuilder

seorankbuilder on December 25, 2016, 10:08 p.m. Reply

I read that Post and got it fine and informative. cannabis buy

seorankbuilder

seorankbuilder on December 27, 2016, 10:02 a.m. Reply

This is my first time visit here. From the tons of comments on your articles.I guess I am not only one having all the enjoyment right here! cannabis hq

seorankbuilder

seorankbuilder on December 28, 2016, 2:57 p.m. Reply

I can see that you are an expert at your field! I am launching a website soon. and your information will be very useful for me.. Thanks for all your help and wishing you all the success in your business. cannabis wholesaler

seorankbuilder

seorankbuilder on December 30, 2016, 6:17 a.m. Reply

Nice knowledge gaining article. This post is really the best on this valuable topic. cannabis clubs

seorankbuilder

seorankbuilder on January 3, 2017, 6:02 a.m. Reply

Thanks for sharing this information. I really like your blog post very much. You have really shared a informative and interesting blog post with people.. cross border wealth management

seorankbuilder

seorankbuilder on January 4, 2017, 6:07 p.m. Reply

I would like to say that this blog really convinced me to do it! Thanks. very good post. Best Western Plus in Kansas city

seorankbuilder

seorankbuilder on January 7, 2017, 8:11 p.m. Reply

Thanks for the post and great tips..even I also think that hard work is the most important aspect of getting success.. how to cultivate cannabis

seorankbuilder

seorankbuilder on January 8, 2017, 6:48 p.m. Reply

Interesting post. I Have Been wondering about this issue, so thanks for posting. Pretty cool post.It ‘s really very nice and Useful post.Thanks cannabis grow racks

seorankbuilder

seorankbuilder on January 9, 2017, 9:22 p.m. Reply

You know your projects stand out of the herd. There is something special about them. It seems to me all of them are really brilliant! click link

seorankbuilder

seorankbuilder on January 11, 2017, 11:06 p.m. Reply

Awesome blog. I enjoyed reading your articles. This is truly a great read for me. I have bookmarked it and I am looking forward to reading new articles. Keep up the good work! english spanish translation service

seorankbuilder

seorankbuilder on January 12, 2017, 1:37 p.m. Reply

I have read your article, it is very informative and helpful for me.I admire the valuable information you offer in your articles. Thanks for posting it.. dentist seo expert

seorankbuilder

seorankbuilder on January 13, 2017, 7:28 p.m. Reply

Thank you for helping people get the information they need. Great stuff as usual. Keep up the great work!!! Partnership For Progress

seorankbuilder

seorankbuilder on January 14, 2017, 7:08 a.m. Reply

This is very educational content and written well for a change. It’s nice to see that some people still understand how to write a quality post! wernerweb.no

seorankbuilder

seorankbuilder on January 14, 2017, 9:36 p.m. Reply

This is just the information I am finding everywhere. Thanks for your blog, I just subscribe your blog. This is a nice blog.. movers in calgary

Real Photos

Real Photos on January 16, 2017, 3:11 p.m. Reply

הנה עקבו אחר בלוג צילום תמונות סקס לטיפים ומדריכים לצלם המתחיל.

בבלוג תמצאו מגוון עצום של מדריכים לשיפור חיי המין ועוד נושאים שונים ומשונים שיעזרו לכם בחיי הסקס.

כמו כן אצלנו באתר תמצאו ביקורות של נערת ליווי להזמנה - אז למה אתם מחכים?

בתודה, צלם.

seorankbuilder

seorankbuilder on January 16, 2017, 6:13 p.m. Reply

Positive site. where did u come up with the information on this posting?I have read a few of the articles on your website now. and I really like your style. Thanks a million and please keep up the effective work. www.DIYRoofs.co

seorankbuilder

seorankbuilder on January 17, 2017, 11:12 a.m. Reply

Thanks for the post and great tips..even I also think that hard work is the most important aspect of getting success.. Attract Women with Pheromone Products for Men

seorankbuilder

seorankbuilder on January 18, 2017, 11:32 a.m. Reply

This is just the information I am finding everywhere. Thanks for your blog. I just subscribe your blog. This is a nice blog.. chunky merino wool blanket

seorankbuilder

seorankbuilder on January 19, 2017, 3:36 p.m. Reply

Your blog provided us with valuable information to work with. Each & every tips of your post are awesome. Thanks a lot for sharing. Keep blogging.. use this link

jams

jams on January 28, 2017, 2:30 p.m. Reply

Great post I would like to thank you for the efforts you have made in writing this interesting and knowledgeable article. malik farhan

jams

jams on January 28, 2017, 2:32 p.m. Reply

I am hoping the same best effort from you in the future as well. In fact your creative writing skills has inspired me. malik farhan

seorankbuilder

seorankbuilder on January 29, 2017, 12:55 a.m. Reply

i am for the first time here. I found this board and I in finding It truly helpful & it helped me out a lot. I hope to present something back and help others such as you helped me. SEO company Calgary

Thomas2017

Thomas2017 on February 8, 2017, 9:39 a.m. Reply

This plugin is really useful… Vikings Season 5 Release Date

seorankbuilder

seorankbuilder on February 9, 2017, 4:22 p.m. Reply

Thanks for your insight for your fantastic posting. I’m glad I have taken the time to see this. more

seorankbuilder

seorankbuilder on February 14, 2017, 9:49 a.m. Reply

hello!! Very interesting discussion glad that I came across such informative post. Keep up the good work friend. Glad to be part of your net community. Зачем нужно учиться​

jams

jams on February 23, 2017, 9:34 a.m. Reply

Please share more like that. Rinjani Trekking Information

jams

jams on February 23, 2017, 10:19 a.m. Reply

thanks for this usefull article. waiting for this article like this again. webtooltest

jams

jams on February 23, 2017, 12:56 p.m. Reply

This is actually the kind of information I have been trying to find. Thank you for writing this information. наука

white smith

white smith on February 27, 2017, 9:09 a.m. Reply

Your post helped me to know about the working of new version and also got some idea about the installation procedures and other features included in it. I am grateful that you provide the use of template tags in order to collect and reorder template content. learn arabic online

seorankbuilder

seorankbuilder on February 27, 2017, 11:58 a.m. Reply

Your website is really cool and this is a great inspiring article. Ganhar Dinheiro Online

seorankbuilder

seorankbuilder on February 27, 2017, 12:15 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 Como Ganhar Dinheiro pela Internet

Annet Rose

Annet Rose on March 1, 2017, 3:52 a.m. Reply

Very happy to know about its new version. I think this blog will be useful to all to learn how to install this new version. I got interested to know more about its features. Hope you will provide this information as soon as possible. Manufactured Housings

jams

jams on March 6, 2017, 3:07 p.m. Reply

Thankyou for this wondrous post, I am glad I observed this website on yahoo. getting inked

jams

jams on March 6, 2017, 3:10 p.m. Reply

Wonderful blog! I found it while surfing around on Yahoo News. Do you have any suggestions on how to get listed in Yahoo News? I’ve been trying for a while but I never seem to get there! Appreciate it. getting inked

seorankbuilder

seorankbuilder on March 12, 2017, 8:24 p.m. Reply

This is very educational content and written well for a change. It’s nice to see that some people still understand how to write a quality post.! strength

jams

jams on March 13, 2017, 10:10 a.m. Reply

I learn some new stuff from it too, thanks for sharing your information. wedding spot

jams

jams on March 18, 2017, 3:49 p.m. Reply

The post is written in very a good manner and it contains many useful information for me. hemorrhoid treatment uk

seorankbuilder

seorankbuilder on March 19, 2017, 4:49 p.m. Reply

I think this is an informative post and it is very useful and knowledgeable. therefore, I would like to thank you for the efforts you have made in writing this article. www.y8games.center

jams

jams on March 20, 2017, 10:12 p.m. Reply

I was reading your article and wondered if you had considered creating an ebook on this subject. Your writing would sell it fast. You have a lot of writing talent. themedojo.com

jams

jams on March 28, 2017, 2:26 p.m. Reply

Yngwie Malmsteen Guitar Setup. As far as electric guitars, there is just a single model that Malmsteen is truly enthusiastic about. On the off chance that you weren’t acquainted with Malmsteen’s work, and you chose to play one of his collections on your stereo, the last guitar you would envision him utilizing is the Fender Stratocaster. Be that as it may, Strats are his frail spot. That, as well as there is a certain scope of Stratocasters that he plays. Guitars made in the period from 1968 to 1972 are worthy, while whatever else is most certainly not. His blonde Strat has turned into his mark thing which is most likely as famous as Malmsteen himself kirk hammett guitar setup

seorankbuilder

seorankbuilder on March 28, 2017, 8:32 p.m. Reply

Awesome article! I want people to know just how good this information is in your article. It’s interesting, compelling content. Your views are much like my own concerning this subject. check this link right here now

jams

jams on April 1, 2017, 8:15 p.m. Reply

You’ve got some interesting points in this article. I would have never considered any of these if I didn’t come across this. Thanks!. short sale company

jams

jams on April 5, 2017, 12:20 p.m. Reply

I wanted to thank you for this excellent read!! I definitely loved every little bit of it. I have you bookmarked your site to check out the new stuff you post. chartered accountants

seorankbuilder

seorankbuilder on April 5, 2017, 4:26 p.m. Reply

I have recently started a blog, the info you provide on this site has helped me greatly. Thanks for all of your time & work. descontos mash

seorankbuilder

seorankbuilder on April 7, 2017, 6:40 p.m. Reply

Very useful post. This is my first time i visit here. I found so many interesting stuff in your blog especially its discussion. Really its great article. Keep it up. Business Broker Manila

jams

jams on April 8, 2017, 7:00 a.m. Reply

Positive site. where did u come up with the information on this posting?I have read a few of the articles on your website now. and I really like your style. Thanks a million and please keep up the effective work. Trekking Rinjani

seorankbuilder

seorankbuilder on April 9, 2017, 10:28 a.m. Reply

Most of the time I don’t make comments on websites, but I’d like to say that this article really forced me to do so. Really nice post! How to Lose Weight

jazzy

jazzy on April 9, 2017, 6:56 p.m. Reply

I read a article under the same title some time ago, but this articles quality is much, much better. How you do this.. breast enhancement pills that work

Zaricot

Zaricot on April 10, 2017, 8:09 a.m. Reply

I used the plugin on my website. But i doesn’t work. Please can you help me ?

jazzy

jazzy on April 11, 2017, 12:28 p.m. Reply

I really loved reading your blog. It was very well authored and easy to understand. Unlike other blogs I have read which are really not that good.Thanks alot!

best natural herbs for weight loss

seorankbuilder

seorankbuilder on April 13, 2017, 9:12 a.m. Reply

The information you have posted is very useful. The sites you have referred was good. Thanks for sharing… passive income

seorankbuilder

seorankbuilder on April 15, 2017, 8:54 a.m. Reply

nice bLog! its interesting. thank you for sharing…. kinja blog posts

mishirajput

mishirajput on April 15, 2017, 9:22 a.m. Reply

An interesting dialogue is price comment. I feel that it is best to write more on this matter. it may not be a taboo topic however usually individuals are not enough to talk on such topics. To the next. Cheers. military alphabet

seorankbuilder

seorankbuilder on April 15, 2017, 12:32 p.m. Reply

Thanks you very much for sharing these links. Will definitely check this out.. Andy1st

seorankbuilder

seorankbuilder on April 15, 2017, 2:37 p.m. Reply

All the contents you mentioned in post is too good and can be very useful. I will keep it in mind. thanks for sharing the information keep updating. looking forward for more posts.Thanks Sourajit

jazzy

jazzy on April 15, 2017, 3:32 p.m. Reply

I know your expertise on this. I must say we should have an online discussion on this. Writing only comments will close the discussion straight away! And will restrict the benefits from this information. headhunter

seorankbuilder

seorankbuilder on April 16, 2017, 5:15 a.m. Reply

Thanks a lot for sharing us about this update. Hope you will not get tired on making posts as informative as this. Pheromones for Men

jazzy

jazzy on April 17, 2017, 5:10 a.m. Reply

This is a great article thanks for sharing this informative information. I will visit your blog regularly for some latest post. I will visit your blog regularly for Some latest post. wedding venue

mishirajput

mishirajput on April 17, 2017, 12:23 p.m. Reply

Thanks for every other informative site. The place else may just I get that kind of information written in such an ideal means? I have a venture that I’m just now operating on. and I have been on the look out for such information. personal injury attorney

jazzy

jazzy on April 18, 2017, 8:17 a.m. Reply

Interesting post. I Have Been wondering about this issue, so thanks for posting. Pretty cool post.It ‘s really very nice and Useful post.Thanks fitness-and-exercise

mishirajput

mishirajput on April 18, 2017, 9:42 a.m. Reply

I know your expertise on this. I must say we should have an online discussion on this. Writing only comments will close the discussion straight away! And will restrict the benefits from this information. energy saver air conditioner

terrilynbealmear

terrilynbealmear on April 19, 2017, 9:28 a.m. Reply

This is a very good tip particularly to those fresh to the blogosphere. Short but very accurate information… Thank you for sharing this one. A must read post! Make sure you watch Joshua vs Wladimir Klitschko Kodi stream on Web

mishirajput

mishirajput on April 19, 2017, 11:36 a.m. Reply

Your content is nothing short of brilliant in many ways. I think this is engaging and eye-opening material. Thank you so much for caring about your content and your readers. expert comptable en ligne

mishirajput

mishirajput on April 20, 2017, 9:45 a.m. Reply

I am unable to read articles online very often. but I’m glad I did today. This is very well written and your points are well-expressed. Please. don’t ever stop writing. save electricity

seorankbuilder

seorankbuilder on April 20, 2017, 11:17 a.m. Reply

I think this is a really good article. You make this information interesting and engaging. You give readers a lot to think about and I appreciate that kind of writing. casas en Miami

jazzy

jazzy on April 20, 2017, 3:13 p.m. Reply

Thank you again for all the knowledge you distribute,Good post. I was very interested in the article, it’s quite inspiring I should admit. I like visiting you site since I always come across interesting articles like this one.Great Job, I greatly appreciate that.Do Keep sharing! Regards, humatrope 12mg

seorankbuilder

seorankbuilder on April 21, 2017, 3:28 p.m. Reply

This blog is so nice to me. I will keep on coming here again and again. Visit my link as well.. best acoustic guitar brands in india

seorankbuilder

seorankbuilder on April 21, 2017, 3:32 p.m. Reply

I have read your blog it is very helpful for me. I want to say thanks to you. I have bookmark your site for future updates. earring accessories

seorankbuilder

seorankbuilder on April 21, 2017, 7:33 p.m. Reply

Pretty nice post. I just stumbled upon your weblog and wanted to say that I have really enjoyed browsing your blog posts. After all I’ll be subscribing to your feed and I hope you write again soon! casas em Orlando

mishirajput

mishirajput on April 22, 2017, 6:05 a.m. Reply

I am unable to read articles online very often. but I’m glad I did today. This is very well written and your points are well-expressed. Please. don’t ever stop writing. look at this web-site

mishirajput

mishirajput on April 22, 2017, 6:07 a.m. Reply

I can’t imagine focusing long enough to research; much less write this kind of article. You’ve outdone yourself with this material. This is great content. look these up

jazzy

jazzy on April 22, 2017, 7:11 a.m. Reply

Great write-up, I am a big believer in commenting on blogs to inform the blog writers know that they’ve added something worthwhile to the world wide web!.. Hundred Palms Residences Hoi Hup Realty

seorankbuilder

seorankbuilder on April 22, 2017, 10:13 a.m. Reply

I wish more authors of this type of content would take the time you did to research and write so well. I am very impressed with your vision and insight. GRANDSTREAM GXP2200 EXT

mishirajput

mishirajput on April 23, 2017, 7:51 a.m. Reply

this is really nice to read..informative post is very good to read..thanks a lot! https associateresources limitedbrands com

mishirajput

mishirajput on April 23, 2017, 11:33 a.m. Reply

Thanks a lot for sharing us about this update. Hope you will not get tired on making posts as informative as this. modalert

mishirajput

mishirajput on April 23, 2017, 11:34 a.m. Reply

Thanks a lot for sharing us about this update. Hope you will not get tired on making posts as informative as this. modalert

jazzy

jazzy on April 23, 2017, 11:42 a.m. Reply

Superbly written article, if only all bloggers offered the same content as you, the internet would be a far better place.. cheap online clothing stores uk

Leave a Comment