Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2009-09-29 16:49:54

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: simple article status display problem, need help

kvnmcwebn wrote:

I think the problem has something to to with using article_custom in the first condtion of this if else statment
(…)
I think you can only use a regular article tag for the first one

Yes, that’s right, article_custom can only display an article list.

I don’t get what your intention is with the limit="999" if you only want to display one article at the time??? This code says to display 999 articles on an individual article page, and 1 article on an article list page…

<div class="content">
<txp:if_individual_article>
<txp:article_custom limit="999"   section="blog"   />
<txp:else /><txp:article_custom  section="blog" pgonly="0" form="home" limit="1"   />
</txp:if_individual_article>

Anyway, just in case you want to display 1 (one) article on an individual article page, and that article can be either live or sticky, try this:

<div class="content">
<txp:if_individual_article>
<txp:article />
<txp:article status="sticky" />
<txp:else />
<txp:article_custom section="blog" form="home" limit="1" />
</txp:if_individual_article>

Offline

#14 2009-09-29 17:49:09

kvnmcwebn
Member
From: Ireland
Registered: 2007-01-27
Posts: 724
Website

Re: simple article status display problem, need help

Thanks a mill for clarifying El’s
Why wouldn’t this display two articles:

<div class=“content”>
<txp:if_individual_article>
<txp:article />
<txp:article status=“sticky” />
….

Last edited by kvnmcwebn (2009-09-29 17:49:24)


its a bad hen that wont scratch itself.
photogallery

Offline

#15 2009-09-29 19:55:29

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: simple article status display problem, need help

kvnmcwebn wrote:

Why wouldn’t this display two articles

Because – in individual article mode – the first tag, <txp:article />, will display a ‘live’ article. If the requested individual article happens to be ‘sticky’, there is nothing for it to display. The same reasoning applies to the second tag, that will only display an article if it’s ‘sticky’.

Last edited by els (2009-09-29 19:57:07)

Offline

#16 2009-09-29 22:28:46

kvnmcwebn
Member
From: Ireland
Registered: 2007-01-27
Posts: 724
Website

Re: simple article status display problem, need help

ok then so the <txp:if_individual_article> tag is only going to display one article no mater how many <article /> tags with what ever attributes you have below it. Makes sense. thanks again for your patience.


its a bad hen that wont scratch itself.
photogallery

Offline

#17 2009-09-29 22:37:13

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

Re: simple article status display problem, need help

Not exactly.

If you have this

<txp:if_individual_article>
<txp:article />
<txp:article />
<txp:article />
</txp:if_individual_article>

You are going to get the corresponding article (the one corresponding to the URL —the individual article permlink— you are visiting) listed three times.

The snippet Els posted will work because <txp:article /> is the same as <txp:article status="live" /> (in other words, status attribute defaults to 'live').


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#18 2009-09-29 23:11:37

kvnmcwebn
Member
From: Ireland
Registered: 2007-01-27
Posts: 724
Website

Re: simple article status display problem, need help

ok so as long as the status of each article tag is different only one article will be displayed.
cheers.


its a bad hen that wont scratch itself.
photogallery

Offline

Board footer

Powered by FluxBB