MB Pro templates and Conditional Expressions **solved**
Posted: Sun Jan 10, 2016 4:34 am
"Add on services - additional features of Meteobridge Pro" describes the facility to store templates in the /data/templates/ network share and call them using http://ip-of-meteobridge/cgi-bin/templa ... ydata.http. I am trying to use this feature with a template which includes conditional expressions but cannot get the conditonal expressions to work - are conditional expressions allowed in templates used this way?
I have tried using the example conditional expression from the end of the Templates examples on its own in a template file stored in /data/templates/:
Max gust in last 10 minutes was: #if#{*[wind0wind-age:999]>600*}#then#--#else#[wind0wind-max10.1:0]m/s, {*[wind0wind-max10.1:0] * 3.6 *1}kph#fi#
but this then returns the following when called from the URL :
Max gust in last 10 minutes was: #if#0.00#then#--#else#6.6m/s, 23.8kph#fi#
The numerical expression is being evaluated but the conditional expression is not then processed.
I have tried using the example conditional expression from the end of the Templates examples on its own in a template file stored in /data/templates/:
Max gust in last 10 minutes was: #if#{*[wind0wind-age:999]>600*}#then#--#else#[wind0wind-max10.1:0]m/s, {*[wind0wind-max10.1:0] * 3.6 *1}kph#fi#
but this then returns the following when called from the URL :
Max gust in last 10 minutes was: #if#0.00#then#--#else#6.6m/s, 23.8kph#fi#
The numerical expression is being evaluated but the conditional expression is not then processed.