Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#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

#2 2008-03-28 19:11:30

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: checking to see if an article has status of "pending"

Only Live and Sticky are meant for use on the front-end.

Offline

#3 2008-03-28 19:51:33

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

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)


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#4 2008-03-28 20:36:41

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

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

#5 2008-03-28 20:47:25

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

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.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#6 2008-03-28 20:58:25

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

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

#7 2008-03-28 21:18:48

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,449
Website GitHub

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

#8 2008-03-29 08:59:29

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

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

#10 2008-03-30 00:49:21

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: checking to see if an article has status of "pending"

kevinpotts wrote:

But it seems only live and sticky statuses display on the public side.

It’s intended and so it should be.

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

Board footer

Powered by FluxBB