Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-04-03 17:47:20

mrtunes
Member
From: Toronto, On
Registered: 2007-03-12
Posts: 575
Website

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

#3 2010-04-03 20:08:45

mrtunes
Member
From: Toronto, On
Registered: 2007-03-12
Posts: 575
Website

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

#5 2010-04-04 10:20:42

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 5,000
Website GitHub

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

#6 2010-04-04 11:39:54

mrtunes
Member
From: Toronto, On
Registered: 2007-03-12
Posts: 575
Website

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

Board footer

Powered by FluxBB