2012-06-24 19:17:14

gaekwad
Member
lambda
Real name: Pete Cooper
From: CrackingtonHaven, Cornwall, UK
Known languages: en-GB
Website

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

 

2012-06-24 19:27:48

Els
Admin
omega
Real name: Els Lepelaars
From: The Netherlands
Known languages: nl, en, (some: de, fr, es, it)
Website

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


<txp:Els /> ;)
Tag Reference | Unexpected behaviour? Check the tag trace | Still no clue? Check the names of your custom fields

Offline

 

2012-06-24 19:28:29

gaekwad
Member
lambda
Real name: Pete Cooper
From: CrackingtonHaven, Cornwall, UK
Known languages: en-GB
Website

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

Perfect – thanks, Els!

Offline

 

2012-06-25 12:07:42

uli
Moderator
omega
Real name: Uli
From: Cologne/Köln
Known languages: de > en

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

 

2012-06-25 12:08:26

gaekwad
Member
lambda
Real name: Pete Cooper
From: CrackingtonHaven, Cornwall, UK
Known languages: en-GB
Website

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

Oh, cool – thanks, Uli, really useful.

Offline

 

2012-06-25 12:11:16

Bloke
Developer
omega
Real name: Stef Dawson
From: Leeds, UK
Known languages: Engl(ish)
Website

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.

Txp Builders – finely-crafted code, design and Txp

Offline

 

2012-06-25 12:12:45

gaekwad
Member
lambda
Real name: Pete Cooper
From: CrackingtonHaven, Cornwall, UK
Known languages: en-GB
Website

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

 

Powered by FluxBB