Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
[SOLVED] article custom conditionals
I am trying to get a list using the article custom tag but I want this list to exclude the current, and another article. This is the code which seems that it is not working as nothing is parsed.
<txp:if_individual_article>
<txp:article_custom section="archive" limit="20" wraptag="ul" break="li">
<txp:if_article_id id='<txp:article_id />,1'>
<txp:else />
<txp:permlink><txp:title /></txp:permlink>
</txp:if_article_id>
</txp:article_custom>
</txp:if_individual_article>
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: [SOLVED] article custom conditionals
Hi Yiannis,
you should set the parent <txp:article_id />
outside of <txp:article_custom />
list:
<txp:variable name="article_id" value='<txp:article_id />' />
<txp:if_individual_article>
<txp:article_custom section="archive" limit="20" wraptag="ul" break="li">
<txp:if_article_id id='<txp:variable name="article_id" />,1'>
<txp:else />
<txp:permlink><txp:title /></txp:permlink>
</txp:if_article_id>
</txp:article_custom>
</txp:if_individual_article>
or, better, use exclude
attribute:
<txp:if_individual_article>
<txp:article_custom exclude='<txp:article_id />,1' section="archive" limit="20" wraptag="ul" break="li">
<txp:permlink><txp:title /></txp:permlink>
</txp:article_custom>
</txp:if_individual_article>
Offline
Re: [SOLVED] article custom conditionals
Thanks so much Oleg…. I have to remember the exclude
attribute… So much simpler. The second script works just fine!
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Pages: 1