Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2011-10-12 23:38:14

frickinmuck
Member
Registered: 2008-05-01
Posts: 118

txp:article displays either live OR sticky = annoyance

Here’s a pet peeve of mine – that is possibly just due to my own limited knowledge – that I really need to find a solution for.

I find it annoying that the txp:article tag will only show live articles OR sticky ones. Is there any way to get it to show the most recent article, regardless of status?

For clarification – I find it really limiting because I like to use status as a flag for some display options, but then it means those articles are basically completely separated from the rest of the content in ALL cases, which. Argh.

Last edited by frickinmuck (2011-10-12 23:39:37)


The AI does not hate you, nor does it love you, but you are made out of atoms which it can use for something else.

Offline

#2 2011-10-13 06:03:35

milosevic
Member
From: Madrid, Spain
Registered: 2005-09-19
Posts: 390

Re: txp:article displays either live OR sticky = annoyance

You can’t. The status is not a way for difference display options. You must use other way for that like a value in a custom field, a special category… anything but status.


<txp:rocks/>

Offline

#3 2011-10-13 07:54:40

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 5,001
Website GitHub

Re: txp:article displays either live OR sticky = annoyance

Mave, that annoys me too. txp used to work that way and at some point it got removed. I’ve campaigned for its reinstatement repeatedly (you’ll find numerous threads in the forum) but to no avail. If I really need it, and a workaround like milosevic suggests adds more overhead than it is worth, I take a dirty shortcut and patch the core.


TXP Builders – finely-crafted code, design and txp

Offline

#4 2011-10-13 07:57:29

merz1
Member
From: Hamburg
Registered: 2006-05-04
Posts: 994
Website

Re: txp:article displays either live OR sticky = annoyance

the txp:article tag will only show live articles OR sticky ones

The old and valid solution is to use txp:article twice. Try ‘sticky’ above ‘live’.


Get all online mentions of Textpattern via OPML subscription: TXP Info Sources: Textpattern RSS feeds as dynamic OPML

Offline

#5 2011-10-13 14:40:30

frickinmuck
Member
Registered: 2008-05-01
Posts: 118

Re: txp:article displays either live OR sticky = annoyance

Yes, Markus, I used to do it that way as well, but then if there are sticky AND live articles in the section, then I end up with one of each.

Jorge, the “all or nothing” solution ignores the fact that articles may need to display differently in different sections or areas of the site, both perfectly valid. For example, suppose that I want an article treated as sticky on the home page, but in the section it belongs to, I want it to be treated like just another article?

I just don’t get why I can’t have txp:article status=“sticky, live” if I choose. What’s the rationale behind limiting it so much? Article is, after all, one of the key tags – one of the most important and most used. Why limit it like that?


The AI does not hate you, nor does it love you, but you are made out of atoms which it can use for something else.

Offline

#6 2011-10-13 14:42:17

frickinmuck
Member
Registered: 2008-05-01
Posts: 118

Re: txp:article displays either live OR sticky = annoyance

jakob wrote:

I take a dirty shortcut and patch the core.

Sadly that sounds like the option available to me. Gah.


The AI does not hate you, nor does it love you, but you are made out of atoms which it can use for something else.

Offline

#7 2011-10-13 14:51:20

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,549
Website GitHub Twitter

Re: txp:article displays either live OR sticky = annoyance

There is also a solution using smd_query that let you choose exactly what youwant by an sql query!

Offline

#8 2011-10-13 14:55:35

frickinmuck
Member
Registered: 2008-05-01
Posts: 118

Re: txp:article displays either live OR sticky = annoyance

That’s actually not such a bad idea, Rabah – thanks.


The AI does not hate you, nor does it love you, but you are made out of atoms which it can use for something else.

Offline

#9 2011-10-13 18:39:56

milosevic
Member
From: Madrid, Spain
Registered: 2005-09-19
Posts: 390

Re: txp:article displays either live OR sticky = annoyance

*frickinmuck

Jorge, the “all or nothing” solution ignores the fact that articles may need to display differently in different sections or areas of the site, both perfectly valid. For example, suppose that I want an article treated as sticky on the home page, but in the section it belongs to, I want it to be treated like just another article?

I think like you. It would be nice to have the option “any” for status.


<txp:rocks/>

Offline

#10 2011-10-14 17:03:19

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: txp:article displays either live OR sticky = annoyance

Offline

#11 2011-10-15 03:22:09

frickinmuck
Member
Registered: 2008-05-01
Posts: 118

Re: txp:article displays either live OR sticky = annoyance

Wow, after reading all that, I’m kind of amazed support for txp:article status=“all” sort=“statusdesc” or some such thing hasn’t been developed. or maybe a plugin providing that functionality. It seems kind of basic – a lot of forum-style blogs use sticky articles alongside regular ones.

At least I’m not alone in my plight! :^}


The AI does not hate you, nor does it love you, but you are made out of atoms which it can use for something else.

Offline

Board footer

Powered by FluxBB