Content last modified Monday 6 March 2017
hop to #bottom
Categories:
Author:
chrisrhee
About It:
Rate it:
  • Helpful?
  • 1 Yes
  • 1 No
Flag it:
Contact Reason [ ? ]

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:

Your comment will NOT be submitted until you click the 'Submit' button on the next pageload.

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?

Thanks
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.
Patchwork:
Very usefull indeed, thanks for your helpfull tip.
Niconemo:

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

I am very grateful for the article ns for the chance to share my experience with the http://nycresumeservices.com/ 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.

Browse

Categories


Articles

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