Textpattern

Return to main site

Related

Frequently Asked Questions

Problems with nested txp:if_.. tags

Q.

Some of my <txp:if_..> tags show up in the HTML output
Nested <txp:if_..> tags aren’t working as expected
Do nested tags work?

A.

Textpattern supports nested tags (i.e. one tag inside another). However, there is one specific limitation.

Nested conditional tags <txp:if_..> work fine, provided you’re nesting a tag inside a different one:

<txp:if_foo>
<txp:if_bar>
...
</txp:if_bar>
</txp:if_foo>

Nesting a tag inside itself won’t work, due to a limitation in the current (Textpattern 4.0) parser:

<txp:if_foo>
<txp:if_foo>
...
</txp:if_foo>
</txp:if_foo>

To work around the problem, put the inner block in a Misc form and use output_form, like this:

<txp:if_foo>
<txp:output_form form="myform" />
</txp:if_foo>

myform:

<txp:if_foo>
...
</txp:if_foo>

Posted 17 August 2005, 10:25 by Alex Shiels

---