roboconf-platform icon indicating copy to clipboard operation
roboconf-platform copied to clipboard

Templating language has no conditional expression ("if"-like)

Open gibello opened this issue 10 years ago • 1 comments

It is impossible to expand a template block according to a complex condition (eg. "if Tomcat.port=8080 || Tomcat.ip=127.0.0.1"). The only check allowed is... whether a String is empty or not !

gibello avatar May 12 '15 09:05 gibello

I have added a helper to select properties in maps. Reading this issue makes me think we could indeed have a == operator that could be applied to keys or values in maps.

See http://doginthehat.com.au/2012/02/comparison-block-helper-for-handlebars-templates/ We might also override the default "if" helper. Or rename it. Or choose another name for our mark-up.

vincent-zurczak avatar Jul 31 '15 16:07 vincent-zurczak