Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
How to make an article expire based on custom field date
I have my articles sorted by custom field for a date, but i was wondering how to automatically expire articles that have past today’s date? it doesn’t have to be expire per se, it could just not show them at all using a conditional.
i looked at ras_if_dates which i have used for a project similar to this in the past, but it seems to be locked to actual posted dates.
Last edited by mrtunes (2010-04-03 17:47:46)
Offline
#2 2010-04-03 19:18:34
- rsilletti
- Moderator
- From: Spokane WA
- Registered: 2004-04-28
- Posts: 707
Re: How to make an article expire based on custom field date
Do you have your article posted dates set in a custom field?
Offline
Re: How to make an article expire based on custom field date
No, it’s just an iso date in the custom field.
Offline
#4 2010-04-03 22:16:32
- rsilletti
- Moderator
- From: Spokane WA
- Registered: 2004-04-28
- Posts: 707
Re: How to make an article expire based on custom field date
Date values can be handled as magnitudes, smd_if will allow you to do that on a conditional basis. You are right that ras_if_dates ties directly to posted,expire, and modified time entries set to the article array and won’t work for what you are describing.
Offline
Re: How to make an article expire based on custom field date
I use msv_if_custom_article_date for this.
TXP Builders – finely-crafted code, design and txp
Offline
Re: How to make an article expire based on custom field date
thanks jakob, that looks like the right plugin, but it doesn’t seem to function properly for me.
i even modified the source like you mentioned in the support thread.<txp:msv_if_custom_article_date is="greaterequal" customfield="5" dateseparator="-" >
<txp:article_custom pgonly="0" section="events" form="events" sortby="custom_5" sortdir="asc" />
</txp:msv_if_custom_article_date>
Offline