Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2006-07-11 02:12:58
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
r1500: sortby and sortdir are deprecated...
… in favour of a more powerful “sort” attribute.
Other tags were already using the sort attribute, only the much older tags article, article_custom and recent_articles were using sortby and sortdir. They now join the fray.
sortby and sortdir should still work as they did before, but you’re encouraged to start using sort when this functionality is available to you: if using the latest svn revision, you can start testing it out right now. Otherwise you’ll need to wait for the next stable release (remember, if you’re looking for the most reliable current copy of Textpattern, use the latest stable release.) :)
If somehow this broke something, please reply here with details.
So, what’s it do?
Before, you might sort an article list like this:
<txp:article sortby="Posted" sortdir="desc" />
which would sort your articles by the posted date descending, or, newest-to-oldest.
What if you wanted to further refine your sorting? You’d be stuck hacking around sortby and sortdir to get what you wanted.
With just the one attribute, sort, you can do:
<txp:article sort="Posted desc, Title asc" />
which would sort articles first newest-to-oldest, then in alphabetical order.
Offline
#2 2006-07-11 07:17:18
- alexandra
- Member
- From: Cologne, Germany
- Registered: 2004-04-02
- Posts: 1,370
Re: r1500: sortby and sortdir are deprecated...
Wow, that´s nice news. I did not test it, sorry but think that is brilliant :) best – a.
Offline
Re: r1500: sortby and sortdir are deprecated...
Yes, these are realy nice news!
Offline
#4 2006-07-11 13:51:23
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: r1500: sortby and sortdir are deprecated...
Perfect!
Offline
Re: r1500: sortby and sortdir are deprecated...
Brilliant!
A hole turned upside down is a dome, when there’s also gravity.
Offline
#6 2006-10-04 11:13:12
- marios
- Archived Plugin Author
- Registered: 2005-03-12
- Posts: 1,253
Re: r1500: sortby and sortdir are deprecated...
How would the possible syntax for pageby attribute be ?
<code>by=“integer”</code> ?
regards, marios
⌃ ⇧ < ⎋ ⌃ ⇧ >
Offline
#7 2006-10-04 12:56:03
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: r1500: sortby and sortdir are deprecated...
How would the possible syntax for pageby attribute be?
The same as it has always been – pageby="integer"
.
Offline
#8 2006-10-05 03:42:14
- marios
- Archived Plugin Author
- Registered: 2005-03-12
- Posts: 1,253
Re: r1500: sortby and sortdir are deprecated...
Mary wrote:
bq. How would the possible syntax for pageby attribute be?
The same as it has always been – pageby="integer"
.
Roger, I confused it entirely, thanks
regards, marios
⌃ ⇧ < ⎋ ⌃ ⇧ >
Offline
Re: r1500: sortby and sortdir are deprecated...
Just wanted to mention, that the new sort mechanism works with recent_articles aswell (here with r1866).
The Alphabetical_Tag_Listing
doesn’t have clear info on this yet, though.
Last edited by jayrope (2006-10-06 10:12:33)
A hole turned upside down is a dome, when there’s also gravity.
Offline