Content last modified Monday 6 March 2017
hop to #bottom
About It:
Rate it:
  • Helpful?
  • 1 Yes
  • 1 No
Flag it:

If you'd like to provide updated information and do not have access to directly edit, please contact the site admin; thanks!

Articles Sorted By Custom Fields

This may seem simple to others, but I searched around for this for days. If you want to sort a list by one of the Custom Fields, do something like this:
<txp:article_custom section="attorneys" limit="100" form="jumpmenu" sortby="custom_4" sortdir="asc" />

This needs to be in a <txp:article_custom /> tag.

The code above is used to sort all of the articles in the attorneys section of a website by their last name(Custom Field 4) instead of their first.

I.E. James C. Waddoups comes after Kelly J. Latimer.

My thanks to chrisrhee for pointing me in the right direction.

* 2011: The above information is outdated. <txp:article sort="custom_3 asc" /> now works.

Article Request Count:

Archived [?]: outdated

Posted here:
13 May 2005
Article modified:
01 Feb 2012

You may want to leave your comments/questions at the Forum thread for quicker feedback. Otherwise, comment away:

Commenting is closed for this article.

Commented (6)

Thanks! I’ve been wondering about this…
Andre (in LA):
Does it work if the custom field contains a date in the form of mm/dd/yyyy? Or maybe yyyy/mm/dd?

Aaron Boswell:
I would think you could sort asc or desc and it would use the date you put in. Other than that, I don’t know.
Very usefull indeed, thanks for your helpfull tip.

Outdated ! < txp:article sort=“custom_3 asc” / >

I am very grateful for the article ns for the chance to share my experience with the here. I hope you all will appreciate it and have some good results from the cooperation.

Subscribe to this article's comments RSS feed. [ ? ]   View Recent Comments across the site.

Would you care to write a comment or visit the forum discussion?

You know you want to visit the Archives.




There are also tag clouds, 'cause those are fun.
Published with Textpattern