[*phx:if=`[*TV1*]`:is=`1`:and `[*TV2*]`:is=`2`:then=`yes`:else=`no`*]
[*TV1:is=`1`:and `[*TV2*]`:is=`2`:then=`yes`:else=`no`*]
[*phx:if=`[*TV1*]`:is=`1`:then=` [*phx:if=`[*TV2*]`:is=`2`:then=`A1`:else=`A2`*] `:else=`A3`*]
[*phx:if=`[*TV1*]`:is=`1`:then=` [*phx:if=`[*TV2*]`:is=`2`:then=`A1`:else=`A2`*] `:else=`A3`*]
$tv = $modx->getTemplateVarOutput(true, $modx->documentIdentifier); $value=$tv['NameOfTV']; return $value;
The best way of learning the API IMO is to watch the code of existing add-ons and see how they do it!
You can’t use and `something` but you can use and:if=`something` / and:ne=`something` ...etc.
Here’s a quick and simple example of a snippet retrieving the value of a TV for the current document :
$tv = $modx->getTemplateVarOutput(true, $modx->documentIdentifier); $value=$tv['NameOfTV']; return $value;
NameOfTV should be replaced with your TV’s name