Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
How do I list expired articles?
I’m trying to build a list of past events using the date and time information saved to each article’s Expires field. Textpattern’s tag builder doesn’t have anything that could help. Anyone?
Offline
#2 2011-07-20 18:27:14
- uli
- Moderator
- From: Cologne
- Registered: 2006-08-15
- Posts: 4,315
Re: How do I list expired articles?
Don’t take the tag builder as the Gospel, use the TXP tag list when you’re lost.
if_expired is what you need inside your form or article tag.
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
Re: How do I list expired articles?
When I am trying to open an article that has reached its expiration date, it seems to be going to error page with code 410. That part is clear as it’s pretty easy to put a conditional tag inside error template and see if the page is expired or not. Problem is how to show that expired content. :-( I’ve tried to get a list of expired stuff using this:
<txp:article_custom limit="100" listform="kalenteri_lista" pgonly="0" searchall="1" status="4" time="past" section="kalenteri" />
So the time is directed to only past published articles. The listform has these (bottom part is done with uli’s help, but expired articles are still not visible):
<li>
<txp:posted format="%d.%m.%Y" />
<txp:if_expires>–<txp:expires format="%d.%m.%Y" /></txp:if_expires>: <txp:title />
</li>
<txp:if_expired>
<li>
<txp:posted format="%d.%m.%Y" />–<txp:expires format="%d.%m.%Y" />: <txp:title />
</li>
</txp:if_expired>
Offline
Re: How do I list expired articles?
kuopassa wrote:
When I am trying to open an article that has reached its expiration date, it seems to be going to error page with code 410.
This might be a daft suggestion but have you checked to see if Publish expired articles is set to Yes in your Advanced Prefs?
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
Offline
Pages: 1