QUESTION:

Can I use one tag as the attribute to another tag?



ANSWER:

Textpattern supports nested tags — that is, enclosing one tag within another. For example, from the default article form:

<txp:permlink><txp:title /></txp:permlink>

It is also possible to use one tag as an attribute for another by embracing the attribute with single quotes:

<txp:article_custom section='<txp:section />' />

Single quotes serve as an indicator to Textpattern that it should feed the result of the embedded tag into the outer tag’s attribute, as opposed to the literal text which is used by embracing an attribute value with the usual double quotes.

See the weblog post on Textpattern’s tag parser for an in-depth explanation.