Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-06-20 22:19:39

pieman
Member
From: Bristol, UK
Registered: 2005-09-22
Posts: 491
Website

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:
  1. list all articles by date
  2. 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

#2 2006-06-20 22:40:10

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

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" />


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#3 2006-06-20 22:45:16

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

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.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#4 2006-06-20 22:46:13

pieman
Member
From: Bristol, UK
Registered: 2005-09-22
Posts: 491
Website

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

Board footer

Powered by FluxBB