Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2007-03-17 08:54:56
- Qwest
- Member
- From: London, UK
- Registered: 2007-01-24
- Posts: 112
Auto Archiving?
Is it at all possible to get txp to archive posts automatically?..
I’m running a club-night website which displays the upcoming events on the homepage. At the moment, the next event is shown but i’d like that event to be archived as soon as it’s finished. Is there a way i could get txp to archive the post depending on a custom-date or something?
My problem is that i forget to remove / archive the event once it’s passed, so it gets advertised even though it’s finished, and the next event doesn’t get the correct exposure.
The website is www.clubtrinity.co.uk if your interested…
Thanks in advance :)
Offline
#2 2007-03-17 09:14:53
- Joey
- Member
- From: Netherlands
- Registered: 2005-01-19
- Posts: 257
Re: Auto Archiving?
Maybe you should take a look at zem_event, a powerfull event manager.
Regards,
Joey
Offline
#3 2007-03-17 11:43:31
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Auto Archiving?
<txp:article time =“future” />
Offline
#4 2007-03-17 12:00:49
- Joey
- Member
- From: Netherlands
- Registered: 2005-01-19
- Posts: 257
Re: Auto Archiving?
Great Els, didn’t know that.
Regards,
Joey
Offline
#5 2007-03-18 09:54:09
- Qwest
- Member
- From: London, UK
- Registered: 2007-01-24
- Posts: 112
Re: Auto Archiving?
Joey, thank’s for the heads-up on zem_event, however, i’ve got my TXP set-up just right for my needs, all i need is the ability to auto-archive. Zem_event looks too complex for my needs. It could over-complicate things. I will keep it in mind for future though as it may come in handy!
Els, this time function on the <txp:article> tag interests me.. Can you tell me more? What does it mean by “Future”, what date does it work from? Can it work from a custom date? I checked the wiki but that wasn’t very fruitful?
Offline
#6 2007-03-18 11:16:19
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Auto Archiving?
Qwest,
Using <txp:article />
without the ‘time’ attribute will use the default value, ‘past’, and display articles with a posted date of ‘now’ and earlier. time="future"
in the article tag for the front page will display only articles with a posted date later than ‘now’.
What I do when I want to display future events, is set the posted date to one day after the event’s date (or the end of the time range). Let’s say an event is scheduled on 6th March 2007 (or from 2nd to 6th March), I set the posted date to 07-03-2007 00:00. Using time="future"
will make the entry disappear at that time.
Using time="past"
in your article tag for the archive page (or leave it out) will show only past entries in the archives.
You can change the posted date in the ‘Write’ screen by clicking ‘More’ (just above the Publish/Save button) and uncheck (if checked) ‘Set timestamp to now’.
Of course this means you can’t use <txp:posted />
to show the events date, but you can use custom fields to do that, or just mention the date(s) in the article body.
Last edited by els (2007-03-18 11:19:51)
Offline
#7 2007-03-18 16:45:59
- Qwest
- Member
- From: London, UK
- Registered: 2007-01-24
- Posts: 112
Re: Auto Archiving?
Els, thank’s for your response! Im using a custom field for the event date already so i’m not too bothered about using <txp:posted />.
Im on txp, i’ll be using this with txp:article_custom… Anything i should know about? or should it still work the same?
edit: I’ve just tried the time=“future”, and even though it does what it’s meant to do, because the posted date is now in the future, the event doesn’t show up on other pages, and wont do until the day after it happens!…
The way the site is set out goes like this: I post an event, give it the custom details & add flyers. The event (if it’s the next one) will appear on the schedule page (full list of upcoming events) and the ‘next event’ page. It also appears on the front page in summary form.
If i adjust the posted date, the event wont appear in the ‘next event’ or ‘schedule’ sections.
Any more ideas?
Last edited by Qwest (2007-03-18 16:56:16)
Offline
#8 2007-03-18 19:18:46
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Auto Archiving?
You’ll have to adjust the article tags for the other pages. I assumed that on your archive page you only wanted to show past events, but you can also use time="any"
, this will show all events, past and future. If you are using the same page template for different sections you might need some conditionals like if_section.
If this is not clear, can you post how and where you are using the article tags so I’ll have a better understanding of what you are trying to do?
The time attribute can be used as well in the article_custom tag, that shouldn’t be problem.
Last edited by els (2007-03-18 19:23:17)
Offline
Pages: 1