condition.variable.isset ViewHelper <vhs:condition.variable.isset>
¶
Variable: Isset¶
Renders the then
child if the variable name given in
the name
argument exists in the template. The value
can be zero, NULL or an empty string - but the ViewHelper
will still return TRUE if the variable exists.
Combines well with dynamic variable names:
<!-- if {variableContainingVariableName} is "foo" this checks existence of {foo} -->
<v:condition.variable.isset name="{variableContainingVariableName}">...</v:condition.variable.isset>
<!-- if {suffix} is "Name" this checks existence of "variableName" -->
<v:condition.variable.isset name="variable{suffix}">...</v:condition.variable.isset>
<!-- outputs value of {foo} if {bar} is defined -->
{foo -> v:condition.variable.isset(name: bar)}
ONLY WORKS ON TYPO3v8+!