[[+url:isnot=``:then=`<a href="[[~[[+url]]]]">Learn more</a>`]]
[2017-05-05 09:19:27] (ERROR in resource 5 @ /www/htdocs/core/model/modx/modparser.class.php : 1353) Bad link tag `[[~]]` encountered
This question has been answered by donshakespeare. See the first response.
[[+url:notempty=`<a href="[[~[[+url]]]]">Learn more</a>`]]
[[+url:isnot=``:then=`<a href="[[~[[+url]]]]">Learn more</a>`:else=``]]
[[+url:default=``:isnot=``:then=`<a href="[[~[[+url]]]]">Learn more</a>`]]
[[[[+url:notempty=`~[[+url]]`]]]]
[[*field:is=`0`:then=`[[!SomeScript]]`:else=`[[$SomeChunk]]`]]
Guess what happens when MODX parses this tag?[ed. note: donshakespeare last edited this post 7 years ago.]
1. Each of the tags contained in the then and the else conditional paths are parsed,
2. The *field tag itself is parsed and
3. Finally, the conditional filter is applied.
[[+url:isnot=``:then=`<a href="[[[[+url:notempty=`~[[+url]]`]]]]">Learn more</a>`]]
[[!DoUrl? &url=[[+url]] ]]
/* DoUrlSnippet */ $url = $modx-getOption('url', $scriptProperties, '', true); return empty($url) ? $url : '<a href="' . $url . '">Learn more</a>';