Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
How to state the status of an article?
In my my article form I’d like to be able to display an arbitary piece of text depending on whether the article has the status “sticky” or not.
My understanding is that <txp:if_status> is used to test the http error code.
There doesn’t seem to be <txp:if_article_status> tag.
How do I do this?
Offline
Offline
Re: How to state the status of an article?
Many thanks – I thought that this would have been part of the core!
Offline
Re: How to state the status of an article?
Thinking it over, it sounds as though you don’t really need the plugin. Just use one form for sticky articles and a different form for live articles, and put the appropriate bit of text in the respective article forms.
However, if the arbitrary bit of text is the only difference between the two forms it would be better to use the plugin.
Code is topiary
Offline
Re: How to state the status of an article?
Yes, I could use separate forms for stick and live articles – however, it seemed a little over the top to use two almost identical forms when a simple if conditional would have done.
Offline
Re: How to state the status of an article?
I think that the new variable tag might be able to do what you want…
Edit: Make the link work..
Last edited by jstubbs (2009-01-17 13:13:28)
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: How to state the status of an article?
Would it? How would you get at the article status?
Here’s another solution:
<txp:php> echo $thisarticle['status'] == '5' ? 'sticky message' : 'live message'; </txp:php>
5 is the status code for sticky articles.
Code is topiary
Offline