Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2015-12-04 11:21:08
- raminrahimi
- Member
- From: India
- Registered: 2013-03-19
- Posts: 278
if article exist in a specific section and category
how i can show something in the page (template) if article exist in a specific section and category?
something like this i tried, but that tag doesn’t exist on txp ;)
<txp:if_article section="news" category="india">
<h1>Show this area</h1>
</txp:if_article>
Last edited by raminrahimi (2015-12-04 11:21:44)
Offline
Re: if article exist in a specific section and category
Use if_article_section and if_article_category nested inside each other.
If category india only ever occurs in the section news, you only need to test for if_article_category
.
TXP Builders – finely-crafted code, design and txp
Offline
Re: if article exist in a specific section and category
Hi raminrahimi,
Other solution :
<txp:variable name="articles-list"><txp:article_custom section="your-section" category="your-category" form="your-form" … />
<txp:if_variable name="article-list" value="">
<p> Sorry, no article for this section and this category </p>
<txp:else />
<txp:variable name="article-list" />
</txp:if_variable>
This solution is valable if you are out of your section and your category context.
Offline
#4 2015-12-04 14:38:18
- raminrahimi
- Member
- From: India
- Registered: 2013-03-19
- Posts: 278
Re: if article exist in a specific section and category
Hi Sacripant and *Jakob” !
Both solutions work fine for me, Thanks :-)
Offline