Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2015-10-06 12:32:23

Gallex
Member
Registered: 2006-10-08
Posts: 1,289

display article list from category they have been saved

hi!

there are many categories under products.
if in individual article page, display article list only from category this current article has been saved.

this is my sidebar code:

<txp:if_individual_article>
<txp:article_custom limit="8" section="products" category='<txp:category />' wraptag="ul" break="li" labeltag="h6" label='<txp:category title="1" />'>
<txp:permlink><txp:title /></txp:permlink>
</txp:article_custom>
<txp:else />
</txp:if_individual_article>

category='<txp:category />' and label='<txp:category title="1" />' not doing it’s job…

is my request doable at all?

Offline

#2 2015-10-06 13:24:10

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,304

Re: display article list from category they have been saved

Try category1/2 instead.


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#3 2015-10-06 13:54:59

Gallex
Member
Registered: 2006-10-08
Posts: 1,289

Re: display article list from category they have been saved

uli wrote #295425:

Try category1/2 instead.

brilliant!! thank you uli!

working code:

<txp:if_individual_article>
<txp:article_custom limit="8" section="products" category='<txp:category1 />' wraptag="ul" break="li" labeltag="h6" label='<txp:category1 title="1" />'>
<txp:permlink><txp:title /></txp:permlink>
</txp:article_custom>
<txp:else />
</txp:if_individual_article>

Offline

#4 2015-10-06 14:37:50

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,304

Re: display article list from category they have been saved

You’re welcome! (You don’t need the else tag, though, if you don’t want to serve alternative code.)


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

Board footer

Powered by FluxBB