Can some body share the template code to sort the entries based on a custom field.
The requirement is to show entries based on the priority of the given entry. The only solution which comes to my mind is to add a custom field and sort it based on it.
If some body has a better solution, please do share it on this forum
Thanks in advance
Reported on Movable Type 4.2

Sure, here's the syntax:
Documented here:
> If you have the Professional Pack installed, with custom fields, you may specify a custom field basename to sort the listing, by giving a sort_by value of field:basename (where 'basename' is the custom field basename you wish to sort on).
THANKS BRAD !
This is what I got from the sample template code of my custom field:
News Priority:
With the basename as "news_priority"
And I was using "MTentry_news_priority" instead of basename because of which it was not sorting on the custom field.
Working Code:
another option is to use MT Order Plugin
Darned if I can get this working in MT4.23.
My custom field basename is folderorder, and my code is:
<MTToplevelFolders sort_by="field:folderorder" sort_order="ascend"> <li><a href="<MTBlogURL><MTFolderBasename>/"><MTFolderLabel></a></li> </MTToplevelFolders>Any idea what I'm doing wrong? Thanks!
correct me if im wrong, but somehow i read somewhere in the wiki, sorting based on custom field only support Entries at the moment?
http://wiki.movabletype.org/Custom_Category_Sorting
Caribou sue, your code got eaten. Might want to try again. In any case, the whole thing is documented here, as Brad mentioned.
[Fixed Sue's code for display]
All right: I've read the documentation, I've searched this and other forums, I have v4.23 with the Professional Pack; and confound it, MT won't sort entries according to any of my custom fields.
Excuse the formatting -- you know what I mean!
[mt:Entries sort_by="field:rating"][output styling, etc.][/mt:Entries]
The above code is for a category page. It appears only to output entries according to weblog defaults (i.e., sorted by author date and in descending order). My field in question is single-line text and numerical (10-50); and "rating" is, indeed, the basename. Attempts with other fields have failed as well.
What have I missed?
Wouldn't it be EntryDataRating?
I don't believe so, since EntryDataRating is the field's template tag; not its basename.
I've run my problem past a couple others, and they believe my follows directions provided in MT's documentation, which leaves me even more confused!
Are there any examples of this feature implemented successfully? Does it even work?
I don't know but this is very important to me as I will be using it in a directory app I am writing. I have paid support though so when I get to that river I will ask them about it.
It's appreciated, Ken. Let us know!
Some possibly relevant cases in FogBugz:
Those are definitely relevant, Jay. Case 98025 describes my problem. I note with some dismay, however, that it hasn't been resolved; perhaps because the error has been poorly articulated. What Chieko means is that on archive pages, the sort command is ignored, and entries are displayed as if from an unmodified tag.
So, is it in fact the case that this only sorts Entries? I *really* need to be able to do a custom sort of folders, not just entries. :( I have the custom field for folders, but the sort_by field:basename doesn't seem to work for them.
There is a solution for sorting entries, via a custom field, on a category page. It's a redundant workaround, but I have confirmed that it works.