QUESTION:

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?



ANSWER:

Textpattern version 4.0.7 and later supports nested tags (i.e. one tag inside another) without any constraint.

Older versions of Textpattern had limited capabilities in this area. Upgrading to the latest Textpattern release is the recommended solution.

Nesting a tag inside itself did not work in older Textpattern releases before 4.0.7:

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

If an upgrade is beyond consideration, there are other ways to nest tags: 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>