Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2007-11-09 20:33:50
- jk215
- New Member
- Registered: 2007-10-24
- Posts: 6
Conditional Statement Help Please!
Hi everyone. I am going to be using textpattern as a way to manage upcoming shows at my work. Thanks to threads on this forum Ive figured out everything except 1 more thing. As of right now, my TXP sorts the upcoming shows by date, and displays the top 6.
ie:
Friday, November 1
SHOWTITLE
_______________
Saturday, November 2
SHOWTITLE
_______________
Sunday, November 3
SHOWTITLE
_______________
etc, etc…
What I would really like to be able to do is have these listings automatically update each day. So if its now Saturday, November 2 then that would be moved to the top of the list, and the next show in queue would be displayed. Im guessing I would use a conditional statement but cant exactly formulate it correctly in my head. Im guessing it would consult the server clock to get the time, compare it to my custom field called “showdate” which holds the date as “2007-11-02” and decide which of the next 6 shows should be displayed. Thanks in advance for any help!
Offline
#2 2007-11-09 20:56:26
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Conditional Statement Help Please!
Why don’t you use the publish date instead of a custom field, and attribute time="future"
in the article tag?
Offline
#3 2007-11-09 21:09:41
- jk215
- New Member
- Registered: 2007-10-24
- Posts: 6
Re: Conditional Statement Help Please!
Im not sure if I understand exactly, but the publish date isnt going to be the date the shows are on. Im looking to publish a bunch of shows, like 3 weeks worth at once, and have the conditional statement decide where to start off the loop and display the 6 upcoming shows.
Offline
#4 2007-11-09 21:14:26
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Conditional Statement Help Please!
Ok, but is there a reason why you can’t use the publish date for the show dates? It would really make it easier to accomplish what you are trying to do.
Offline
#5 2007-11-09 21:20:09
- rsilletti
- Moderator
- From: Spokane WA
- Registered: 2004-04-28
- Posts: 707
Re: Conditional Statement Help Please!
Might take a look at these, they only control display choices not what is actually returned by the article tag, but it may provide you with some good options.
plugin ras_if_dates
Example code
Offline
Pages: 1