Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-10-20 23:20:37

parlour
Member
From: Germany
Registered: 2006-09-01
Posts: 20

… sort ascending but show only the three most recent articles?

I have a very simple date list. One article for every month and then just the dates in every article. The articles are all in the “Date” category and displayed as a list.

I limited the number of articles shown to three, so at the moment December, November and October are shown. In that oder. Obviously showing October first and December last would be a lot better. Now I know how to sort ascending (by date posted) but that won’t help. Because: It will then display only the three oldest articles (which are obviously not October, November and December but June, July and August).

How can I sort ascending (and by date posted; i.e. in reverse chronological order) but nevertheless display only the most recent articles?

Offline

#2 2006-10-21 00:35:19

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

Re: … sort ascending but show only the three most recent articles?

<txp:article limit="3" sort="asc" />

Offline

#3 2006-10-21 13:20:11

parlour
Member
From: Germany
Registered: 2006-09-01
Posts: 20

Re: … sort ascending but show only the three most recent articles?

Jep, that’s my problem exactly. I’m using what you suggested right now (I’m still using “sortdir” ’cause I’m still using 4.0.3, maybe that has something to do with the problem?) and that leads to the problems I have.

It doesn’t display the three most recent articles but it shows the three oldest articles. That’s perfectly logical considering what you entered for “sort” (or “sortdir” in my case), but that’s the wrong behavior in my case. How can I change that?

Offline

#4 2006-10-21 13:41:24

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: … sort ascending but show only the three most recent articles?

I doubt if this is possible even in 4.0.4. You could use a plugin though: chh_article_custom lets you use the attribute time="-3 months" (articles published in the last three months).

Offline

#5 2006-10-21 18:30:13

parlour
Member
From: Germany
Registered: 2006-09-01
Posts: 20

Re: … sort ascending but show only the three most recent articles?

Dang! But thank you, that Plug-in looks really like a good solution. Not exactly what I wanted (the dates are not necessarily posted in a 3 month rhythm), but it will work.

Offline

Board footer

Powered by FluxBB