Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Expiry Date for articles for basic event management?
I’ve been looking for a way to add an expiry date for articles, and found a few plugins, but their functionality is a little confusing. I want to add simple events to a site, and something like zem_event feels like to much for what I need, and I would prefer the client to use the same title and body fields as they would for entering other site content.
What I ideally need is an extra field below the article posted date, so that I can add an end date for an event, and then a tag that allows for separation between past, current and future events. Does such a thing exist? I could use custom fields for the end date, but I’m not sure if that information could be filtered? If anyone knows if it can then please tell!
Cheers,
Jon VC#9
Offline
#2 2007-08-02 13:58:32
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Expiry Date for articles for basic event management?
You probably already thought about this, but I use a custom field for the start date (like 2007-08-02, so that it can be sorted alphabetically), and the posted date for the end date. And I never tried this, but it might even be possible to change a custom field’s type to date, and use PHP to select current events.
Offline
Re: Expiry Date for articles for basic event management?
I guess that would allow you to filter off articles that are past using default tags and attributes, but as you say you’d need to do some clever hacking to get the current articles to be filtered off. A low hack solution is to apply catgeories, but I think its too much to expect a client to manually change the category from say, ‘future’ to ‘current’ if it can be done automatically.
Cheers,
Jon VC#9
Offline
#4 2007-08-04 10:37:58
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: Expiry Date for articles for basic event management?
Offline
Re: Expiry Date for articles for basic event management?
Yes, I’ve been looking at those, and ras_delete_expired is close, in that it tests for an expiration date, but it then needs to sort between past, current and future. Maybe I can hack that though?
Cheers,
Jon VC#9
Offline
#6 2007-08-04 12:49:31
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: Expiry Date for articles for basic event management?
I think this might do it (found it linked to by the other plugin):
ras_if_dates_today returns all articles posted to the date set with setdate, default is the current day. If the offset attribute is used, what is considered today is offset into the past or future by the value set in integer days, if setdate is set offset is disregarded. ras_if_dates_before returns all articles posted before, but not to include by default, the date set with setdate. ras_if_dates_after returns all articles posted after, but not to include by default, the date set with setdate.
Offline
#7 2007-08-04 15:29:04
- rsilletti
- Moderator
- From: Spokane WA
- Registered: 2004-04-28
- Posts: 707
Re: Expiry Date for articles for basic event management?
I’ve a copy of TXP with wet’s expire mod installed, it integrates much better than my plugins. It’s installed in TXP 4.0.4 and I’ve never found a problem. I could give you a link if you’re interested, but I can’t provide any kind of support for what might be interpreted as a branch.
Offline
Re: Expiry Date for articles for basic event management?
I have continued to nurture this mod into 4.0.5+. It’s inofficial (basically it’s a laboratory setup for 4.1), but it runs on most of my sites. If your client can cope with development builds, it’s available.
Last edited by wet (2007-08-04 18:01:51)
Offline
#9 2007-08-04 18:20:36
- rsilletti
- Moderator
- From: Spokane WA
- Registered: 2004-04-28
- Posts: 707
Re: Expiry Date for articles for basic event management?
I’ve adapted some of the plugins you’ve been looking at above to run with this mod as well. Plugin.zip
Last edited by rsilletti (2007-08-11 00:40:35)
Offline
Re: Expiry Date for articles for basic event management?
Wet – that looks like exactly what I’m looking for! Does it allow you to output the expiry date in the same way as txp;posted ? I’d love to have a play with it if I can.
Cheers,
Jon VC#9
Offline
Re: Expiry Date for articles for basic event management?
Yes, it has a tag <txp:expires />
which clones <txp:posted />
in all aspects. Plus, there’s a conditional <txp:if_expires>
, which checks for the presence of an expiry date to produce output depending on that fact.
Offline
Re: Expiry Date for articles for basic event management?
Wonderful! Where can I find this Wet?
Cheers,
Jon VC#9
Offline