Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
Today's featured article
I have a bunch of articles, and I would like to display a different one each day in an order that I specify ahead of time — not randomly. How do I do it?
Mark
Offline
Re: Today's featured article
Set the publication date to the date when you want to show the article and use limit=“1” in the txp:article tag to show just one article.
Offline
Re: Today's featured article
That would, I believe, preclude the article from showing up at all until the specified date. What if I wanted people to be able to read the articles at any time if they navigated to various categories, but have one of those articles show up on the front page as a featured article? Is there a way, perhaps, that I could rotate through them on a daily basis?
Mark
Offline
Re: Today's featured article
You could set the day of year as a value of a custom field (named customfield1) and use the article_custom list to show a list of just one article that matches the current day of year, using asy_wondertag:
<txp:asy_wondertag><txp:article_custom limit="1" customfield1="<txp:php>echo date('z');</txp:php>" /></txp:asy_wondertag>
In the upcoming TXP 4.0.7, it could be done like this:
<txp:article_custom limit="1" customfield1='<txp:php>echo date(''z'');</txp:php>' />
Last edited by ruud (2008-09-04 21:23:06)
Offline
Re: Today's featured article
Thanks. I’ll give it a try.
Mark
Offline
Re: Today's featured article
txp:custom_list
?
Did you mean txp:article_custom
?
Offline
Re: Today's featured article
Yes, I’ll update the example in my post.
Offline
Re: Today's featured article
Strangely enough, the asy_wondertag plug-in is not listed at Textpattern Resources. I had to hunt it down in the forums.
Mark
Offline
Pages: 1