Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Detecting existence of articles for a given date, month & year
I’m trying to reverse-engineer some blog sidebar furniture from time gone by: links to articles on a given date, or month / year. I’m not getting very far in how this plugs together, so I’m here with a polite request for some guidance.
The ones I’ve seen usually have a list of days or months, sometimes in a month-view calendar or diary format, where the date is hyperlinked to the article(s) for that day. If the month-view calendar doesn’t have any articles for that date, the date isn’t hyperlinked. How on earth is this achieved without chewing through a database with queries? I’d really appreciate a pointer for some further reading, if such a thing exists.
Thank you.
PS: I even went to Textplates(.com) to find some old-old templates to pull apart, but alas it’s fallen to bit-rot and the themes (& associated previews) aren’t accessible.
Offline
Offline
Re: Detecting existence of articles for a given date, month & year
Thank you, etc – perfect.
Offline
Re: Detecting existence of articles for a given date, month & year
Just for the record, if you only want to count Y-m-d articles, no plugin is needed:
<txp:article_custom fields="DATE[%Y-%m-%d](posted)" limit="0">
<txp:posted format="%Y-%m-%d" /> (<txp:yield item="count" />)
</txp:article_custom>
Offline