Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2012-01-31 16:59:31

mrtunes
Member
From: Toronto, On
Registered: 2007-03-12
Posts: 575
Website

else if statement ?

i found an old thread on the topic that seemed inconclusive, so i’m wondering if there were any updates to the core to accomodate this need.

<txp:if_article_category name=“blab”>
<p>show content</p>
<txp:else />
show other content
<txp:elseif name=“blab3” />
show a third set of content
</txp:if_article_category>

is smd_if the best choice to tackle this, and if so how do i use it for this purpose?

Last edited by mrtunes (2012-01-31 16:59:45)

Offline

#2 2012-01-31 21:07:55

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

Re: else if statement ?

<txp:if_article_category name="blab">
   <p>show content</p>
<txp:else />
   <txp:if_article_category name="blab3">
      show a third set of content
   <txp:else />
      show other content
   </txp:if_article_category>
</txp:if_article_category>

In theory you can nest as many conditional tags as you like. Just remember to close them all at the end ;)

Offline

#3 2012-01-31 21:09:38

mrtunes
Member
From: Toronto, On
Registered: 2007-03-12
Posts: 575
Website

Re: else if statement ?

Els wrote:

In theory you can nest as many conditional tags as you like. Just remember to close them all at the end ;)

got it. thank you!

Offline

Board footer

Powered by FluxBB