<txp:if_section /> container tag, 1 attributes


The if_section tag is a conditional tag and always used as an opening and closing pair, like this…

...conditional statement...

The tag will execute the contained statements if the called page is part of the section specified with the name attribute.


  • Comma-separated list of section names. For the default section, either use the text default or a single comma (for example, both name=”, other_section” and name=“default, other_section” are equivalent).
<txp:if_section /> 2 examples

Conditionally display text for a section

<txp:if_section name="about">
  <p>danger, ego pages ahead!</p>
<txp:else />
  <p>nothing. just nothing. any ideas? anybody?</p>

Other tags used: else

Add a special class to mark the currently active section

<ul class="nav">
  <li<txp:if_section name=",article"> class="active"</txp:if_section>>
    <txp:section link="1" title="1" name="" />
  <li<txp:if_section name="portfolio"> class="active"</txp:if_section>>
    <txp:section link="1" title="1" name="portfolio" />
  <li<txp:if_section name="about"> class="active"</txp:if_section>>
    <txp:section link="1" title="1" name="about" />

A different way of marking the active section can be accomplished by using section_list and its attribute active_class. While the above snippet will mark the list item, section_list will mark solely the link.

Other tags used: section