Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: same URL-only title and article status
ricetxp wrote:
The article was for a competition.
Just as an aside, the smd_countdown plugin might help here.
I kind of understand why you might want two articles — pre and post event — but I don’t think there’s much need unless you don’t want your authors to see tags in the article Body. I may have missed something in the above discussion, though.
How about using the ‘else’ part of smd_countdown to display the info for before the event, set the expiry of the article as maniqui suggests (and allow expired articles to be published in Advanced Prefs) and then use the ‘true’ branch of smd_countdown to display different information once the article expiry is reached:
<txp:smd_countdown to="expires">
Sorry, competition closed.
<txp:else />
Hurry, hurry and get your entries in. You only have <txp:smd_time_info display="day_total"> days left!
</txp:smd_countdown>
EDIT: if_expired would allow you to do the same sort of thing without the handy countdown…
Last edited by Bloke (2010-06-25 16:47:05)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
Re: same URL-only title and article status
@Steff smd_countdown has worked a treat. FYI this is how I’m using it in an article form:
<h2><txp:title /></h2>
<div class="content offer offer-<txp:article_url_title />">
<txp:if_custom_field name="pre-release">
<txp:smd_countdown to="?pre-release">
<txp:php>
...competition logic...
</txp:php>
<txp:else />
<txp:body />
</txp:smd_countdown>
<txp:else />
<txp:php>
...competition logic...
</txp:php>
</txp:if_custom_field>
</div>
Thanks everyone for all the help.
Offline