Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2008-03-28 18:30:46
- kevinpotts
- Member
- From: Ghost Coast
- Registered: 2004-12-07
- Posts: 370
checking to see if an article has status of "pending"
Is there a simple way to test if an article has a status of pending? I know wet_if_status exists, but that only covers Live and Sticky.
I am building a multi-author site that uses editorial workflow, and on the site itself, I’d like to display both Live and Pending articles, with the latter having some text next to it like “this article is currently awaiting approval” or something.
Any thoughts? Am I missing something obvious?
Kevin
(graphicpush)
Offline
Re: checking to see if an article has status of "pending"
Only Live and Sticky are meant for use on the front-end.
Offline
Re: checking to see if an article has status of "pending"
@ruud, do you mean that a pending article won’t show up or maybe bring some kind of “trouble”?
@kevinpotts
Maybe you can approach your problem this way:
- install rvm_privileged plug-in
- then, try if this idea works
- also, if you don’t need both “live” and “pending” articles to be on the same article flow, you can use two article tags on your page template:
<txp:article status="4" />
(for live articles)<txp:article status="1" form="pending-article" />
(for pending articles, so you can add your customized message on that “pending-article” form)
Last edited by maniqui (2008-03-28 20:01:04)
Offline
Re: checking to see if an article has status of "pending"
What I mean is: the fact that this gives results, is what I consider a bug: <txp:article status="1" />
Offline
Re: checking to see if an article has status of "pending"
I wouldn’t consider a bug that the tag gives results, because it’s what you are asking: articles with status=“1”.
I would consider a bug if you are asking for them (<txp:article status="1" />
) and you get nothing.
In fact, if what I’m suggesting to kevinpotts works, then I think it’s a fair, practical and good use:
you can see pending articles on a special private section (or even, on the same-section, because if
I’m not wrong, rvm_privileged has some conditional tags, so <txp:article status="1" />
could be wrapped on those conditional tags) and so, you can test how those articles will be seen when published.
Offline
Re: checking to see if an article has status of "pending"
If that’s the intended purpose, being able to preview an article properly, then I’d rather see a proper preview from the back-end, than using such a workaround in templates.
Offline
Re: checking to see if an article has status of "pending"
ruud wrote:
I’d rather see a proper preview from the back-end, than using such a workaround in templates.
So would I! If I click the sideways ‘Preview’ tab to render an article I get a textual representation of what the page might look like if it had no CSS or embedded tags/plugins/javascript. Until that shows me what will be rendered when the article is ‘live’ (which, to be fair, is probably a tall order given the links like next/prev and conditionals may not operate properly) I’m sticking to my “hidden” section which at least gives a 95% good indication of how the page will look.
@Kevin: did you check out pat64’s (I think) thickbox-preview-on-the-write-page, btw? Can’t find the post now and I’m not entirely sure it’s what you want, but it might be an alternative.
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: checking to see if an article has status of "pending"
Pat64’s thickbox additions.
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
#9 2008-03-29 12:26:20
- kevinpotts
- Member
- From: Ghost Coast
- Registered: 2004-12-07
- Posts: 370
Re: checking to see if an article has status of "pending"
This is not about previewing the content of the plugin on the website, though I do agree that could be better. This is just about identifying to site visitors what articles have pending changes — which ones have to be approved by the Publisher. I’ve resorted to splitting the list into two difference <txp:article_custom />
tags, one with a “live” status, another with “pending” status. You can see the work in progress.
It would be nice if visitors could actually click and view the article, however, and maybe I could style it so its grayed out a bit to indicate it’s still in workflow. But it seems only live and sticky statuses display on the public side.
Kevin
(graphicpush)
Offline
Offline
#11 2008-03-30 17:31:46
- kevinpotts
- Member
- From: Ghost Coast
- Registered: 2004-12-07
- Posts: 370
Re: checking to see if an article has status of "pending"
But it seems only live and sticky statuses display on the public side.
It’s intended and so it should be.
Maybe. I could see both sides of that argument. I would say “Hidden” is the best semantic option for not displaying on the page. But for collaborative environments, ones where there is true editorial workflow within an intranet, it would be very useful if “draft” and “pending” articles were viewable. I would keep the status attribute of “live” the default in <txp:article />
and <txp:article_custom />
, but at least provide the option of displaying others as individual articles.
Kevin
(graphicpush)
Offline