Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
display status="live" status="sticky" articles together
<code><txp:article /></code> doesn’t seem to support multiple values in the <code>status</code> attribute…
Maybe stickies aren’t what I need…(?)
Basically I’m looking for the easiest way to both:- list all articles by date
- and display a brief list of ‘featured’ or ‘recommended’ articles which can be defined by the site author.
I thought that defining the ‘recommended’ articles using sticky status would be simple and logical for the user. But that makes them disappear from the full article list.
Is there another way to acheive <code><txp:article status=“live,sticky” /></code>?
Offline
Re: display status="live" status="sticky" articles together
Hi pieman
Are you trying to get a list like this:
- live article
- sticky article
- sticky article
- live article
- sticky article
- live article
and so on?.
I dont know if that is possible.
But you should try using a custom field.
That way, all your articles are “live”, but you can filter them by a custom field.
For the full article list (including recommended ones): <txp:article />
For the recommended article list: <txp:article customfieldname="customfieldvalue" />.
Example: <txp:article recommended="1" />
Offline
Re: display status="live" status="sticky" articles together
Also, then, in your full article list you can do some tricks.
in your article form you can add:
<code><txp:if_custom_field name=“recommended” val=“1”>
<div class=“article recommended”>
<txp:else />
<div class=“article normal”>
</txp:if_custom_field>
… blablabla… txp article tags…
</code>
And then you can add special CSS for the recommended article.
Offline
Re: display status="live" status="sticky" articles together
yep, you got it pretty spot on there maniqui…
I’d thought of using a custom field but I seem to be using them for everything at the moment and it’s getting a bit unusable!
Being able to use the article status would be so much more intuitive, were it possible.
Offline