Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2025-10-03 19:34:14

Brodex
New Member
Registered: 2025-10-02
Posts: 3
Website

0ne article to always be displayed before the others

Hello, I don’t have much experience or knowledge, so I’ll ask here :)
I would like one article (id=2) to always be displayed before the others.

Here is the beginning of the code that probably needs to be changed:

<txp:if_article_list>
   <h1 itemprop="name"><txp:section title /></h1>
        <txp:article class="article-list" form="article_listing" limit="10" wraptag="ul" />

I will be grateful

Offline

#2 2025-10-03 21:24:06

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

Re: 0ne article to always be displayed before the others

If you set your article with id#2 to Sticky status, you can “glue” it to the top of your article lists.

Depending on the way your pages and forms are laid out, you can either pull it out separately:

<txp:hide>Display sticky article</txp:hide>
<txp:article status="sticky" form="article_listing" />
...
<txp:hide>Display regular articles</txp:hide>
<txp:article form="article_listing" />

Or pull it out with your live articles, and it’ll be shown first:

<txp:article status form="article_listing" />

Hope that helps.


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

#3 2025-10-03 23:34:55

Brodex
New Member
Registered: 2025-10-02
Posts: 3
Website

Re: 0ne article to always be displayed before the others

It’s not working 100% for me. But I figured out that all I need to do is change the article’s publication date/time. Thanks for the help anyway.

Offline

#4 2025-10-04 07:28:39

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

Re: 0ne article to always be displayed before the others

Brodex wrote #340829:

all I need to do is change the article’s publication date/time.

Yeah, if your article tag is sorted by date, that also works. Glad you found a solution.


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

#5 2025-10-04 19:18:24

Brodex
New Member
Registered: 2025-10-02
Posts: 3
Website

Re: 0ne article to always be displayed before the others

I’m just learning and I must admit that I’m impressed with textpattern ;)

<txp:output_form form="priorytet_art" />
<txp:article id="3" form="article_listing" />

And that’s it.

Offline

#6 2025-10-04 19:36:01

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

Re: 0ne article to always be displayed before the others

Brodex wrote #340842:

I’m just learning and I must admit that I’m impressed with textpattern ;)

That’s great to hear.

Forgot to welcome you earlier, sorry… so, welcome aboard. Great to have you here. The docs cover most stuff (and will be undergoing some changes when 4.9.0 is released) and the tags should help if you ever wonder “can I do this in Textpattern?”

Otherwise, play around, and if there’s anything we can help with, please ask here.


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 2025-10-04 22:04:54

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

Re: 0ne article to always be displayed before the others

Bloke wrote #340828:

Or pull it out with your live articles, and it’ll be shown first:

<txp:article status form="article_listing" />...

Out of curiosity, is that true: if you use a valueless status attribute, does it always do sticky before live, or according to sort order?


TXP Builders – finely-crafted code, design and txp

Offline

#8 2025-10-04 22:21:00

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

Re: 0ne article to always be displayed before the others

jakob wrote #340853:

if you use a valueless status attribute, does it always do sticky before live, or according to sort order?

Actually, you might be right because default sort is Posted desc. I thought it did status first and then Posted desc, but maybe it doesn’t.


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

Board footer

Powered by FluxBB