Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-04-12 21:11:35

SuperMAG
Member
Registered: 2010-04-04
Posts: 35

I have a problem with sticky and live thing.

Suppose i have 5 articles and one of them is sticky, and i want to show only one item of those articles in that section url, so i made it sticky one to show:

Like Section URL: http://sports2all.com/extras/

that section shows my sticky article, but the article that is sticky, when you click on it shows empty page:

The Sticky article on that section: http://sports2all.com/extras/extras

my page template code is like this:

		<div class="hfeed">
		<txp:article listform="article_listing" limit="1" />
		</div>
<txp:else />

		<div class="hfeed">
		<txp:if_article_list>
		<!-- section page: display the sticky article -->
		<txp:article status="sticky" limit="1" />
		<txp:else />
		<!-- article page: display the live article -->
		<txp:article limit="1" />
		</txp:if_article_list>
		</div>

Offline

#2 2010-04-12 21:38:37

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

Re: I have a problem with sticky and live thing.

Hi SuperMAG,

your code above is a bit incomplete (I see a <txp:else /> but the wrapping conditional tags are missing).

Anyway, yes, this is an known mmmm bug/feature/quirk (not sure which one yet).

You will need to put too <txp:article /> tags inside the individual article context:

bc. <txp:if_article_list> <!— section page: display the sticky article —> <txp:article status=“sticky” limit=“1” /> <txp:else /> <!— article page: display the live article —> <txp:article status=“live” /> <txp:article status=“sticky” /> </txp:if_article_list>

Don’t bother about using limit="1" in your individual article context, as it will just output one article anyway.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#3 2010-04-12 22:42:46

SuperMAG
Member
Registered: 2010-04-04
Posts: 35

Re: I have a problem with sticky and live thing.

mmm, sorry i couldnt understand, i dont have the individual article thing, here the full code, what exatly should i change in it, can you please post the correct code that will work, thanks alot for helping btw.

<txp:if_category>
		<h2><txp:category title="1" /></h2>

		<div class="hfeed">
		<txp:article listform="article_listing" limit="1" />
		</div>
<txp:else />

		<div class="hfeed">
		<txp:if_article_list>
		<!-- section page: display the sticky article -->
		<txp:article status="sticky" limit="1" />
		<txp:else />
		<!-- article page: display the live article -->
		<txp:article limit="1" />
		</txp:if_article_list>
		</div>

</txp:if_category>

Last edited by SuperMAG (2010-04-12 22:43:44)

Offline

#4 2010-04-12 22:47:18

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

Re: I have a problem with sticky and live thing.

<txp:if_category>
		<h2><txp:category title="1" /></h2>

		<div class="hfeed">
		<txp:article listform="article_listing" limit="1" />
		</div>
<txp:else />

		<div class="hfeed">
		<txp:if_article_list>
		<!-- section page: display the sticky article -->
		<txp:article status="sticky" limit="1" />
		<txp:else />
		<!-- article page: display the live article -->
		<txp:article />
		<txp:article status="sticky" />
		</txp:if_article_list>
		</div>

</txp:if_category>

Offline

#5 2010-04-13 11:04:17

SuperMAG
Member
Registered: 2010-04-04
Posts: 35

Re: I have a problem with sticky and live thing.

Nice, it worked, thanks alot both of you, and btw, my page loading become much faster when i did that. lol anyway thanks.

Offline

Board footer

Powered by FluxBB