Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-08-17 01:00:14

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

txp:article on indiv article context shouldn't output sticky article?

I supposed a <txp:article /> tag on an sticky individual article context was going to output the sticky article.
In other (coded) words, I supposed this was going to work fine:

<txp:if_article_list>
    <txp:article form="article" status="sticky" limit="1" />          
<txp:else />         
    <txp:article form="article" />
</txp:if_article_list>

The very simple idea behind the code is the tipical situation of outputting an sticky article on section landing page (an article list context) and a live/sticky article in individual article context.
In fact, long time ago, it worked. The second <txp:article /> will output the sticky article when on individual article context.

But then, I’ve a totally blurred idea that zem may have changed this behavior some month after my how-to post.

So, the questions are:

  1. shouldn’t it work?
  2. what could be a reason to have changed the old behavior? (or, better, is it a bug or the change was made on purpose?)

BTW, the “workaround” is this:

<txp:if_article_list>
    <txp:article form="article" status="sticky" limit="1" />          
<txp:else />         
    <txp:article form="article" status="sticky" />          
    <txp:article form="article" status="live" />
</txp:if_article_list>

It’s OK, I can live with the duplicated txp:article tag, but it feels a little awkward


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB