Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2012-06-24 19:17:14

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,132
GitHub

Is there something akin to <txp:if_article_status> available?

Hi.
I’m trying to get my head around Live and Sticky articles, and I’m stumbling when it comes to determining the status of an article. What I’d like to do is run a check for if an article has the status of Sticky, like this (bogus tag used):

<txp:if_article_status status=“sticky”>
<p>Article is sticky.</p>
<txp:else />
<p>Article is not sticky.</p>
</txp:if_article_status>

I can’t see anything that might be able to extract the status from an article. How might I go about achieving this?

Thank you in advance.

Offline

#2 2012-06-24 19:27:48

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Is there something akin to <txp:if_article_status> available?

Offline

#3 2012-06-24 19:28:29

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,132
GitHub

Re: Is there something akin to <txp:if_article_status> available?

Perfect – thanks, Els!

Offline

#4 2012-06-25 12:07:42

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,303

Re: Is there something akin to <txp:if_article_status> available?

There are some article fields queryable by TXP’s custom field tags, status is among them:
<txp:if_custom_field name="Status" value="5">Sticky</txp:if_custom_field>.


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#5 2012-06-25 12:08:26

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,132
GitHub

Re: Is there something akin to <txp:if_article_status> available?

Oh, cool – thanks, Uli, really useful.

Offline

#6 2012-06-25 12:11:16

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

Re: Is there something akin to <txp:if_article_status> available?

I was going to mention that yesterday but stopped myself at the last moment. Since it’s technically a bug (albeit a safe one), relying on it is probably not advised. But practically speaking, it’s not going away any time soon.

Last edited by Bloke (2012-06-25 12:11:48)


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

#7 2012-06-25 12:12:45

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,132
GitHub

Re: Is there something akin to <txp:if_article_status> available?

Thanks, Stef – I ended up going for wet_if_status in the end, fits the requirement perfectly.

Offline

Board footer

Powered by FluxBB