Hi all,
First :
Thanks for all your modx job, really impressive guys
Now, after this ’I love you guys’ phasis, let’s go to the main subject : Template Logic
Since we started working on Modx with a collegue of mine, we found that it missed a kind of TemplateLogic.
Situation :
"Imagine you have a template in which you want to display a picture (url defined in a TV:image). This image will be linked to a document (ID defined in another TV : doc).
In term of presentation, if image url is not defined ... it will not be really pretty

. If there is no id, a link will be created to [~~] ... "
The only way to avoid si ’dirty’ behaviour was to create a snippet to verify if ’image’ and ’doc’ were defined and then ad the chunk. If not, no display...
This solution is interesting except that for each TV/parameter and/or condition (perhaps it won’t be empty but <19 or <>"bye", ...) you have to create a new snipet.
Moreover, in our opinion, it is clearly not the snippets role to define the way HTML part will be displayed. We also don’t want to rely on Javascript ( :’( )
To solve our disappointement

, we developped our TemplateLogic
It will be released soon as a plugin (our development was made modifiying Modx Parser so we cannot publish it as it is

)
Our idea :
Add new ’tags’ to be parsed by Modx to decide or not to display part of HTML template.
Syntax :
[-if &condition=`true`-]
test if
[-endif-]
[-if &condition=`[+author+]==13` -]
HTML texts / chunk calls / snippet calls ...
[-else-]
HTML texts / chunk calls / snippet calls ...
[-endif-]
Syntax2 (under study) :
{{chunkName? &type=`if` &condition=`[*id*]==12` }} to be really close to snippet call syntax ...
I’ll come back later to publish our plugin in a documented Way

but BTW, please feel free to give us your comments on this.
(perhaps we missed some feature in Modx that can do what we were looking for ...)