title: How to find out if a data is not null using if statement in Smarty?
body: <p>I am studying smarty right now. And I found out that it is really good. But I encountered an error and I don't have an idea how to fix this. Because I have a code written in PHP and I convert this into smarty template. </p>
  
  <p>I have an if statement but when validating the data I got an error</p>
  
  <pre><code>Fatal error: Smarty error: [in addons/maptool/views/maps/update.tpl line 59]: syntax error: unrecognized tag: if(!$locations.updated_lat ? $locations.updated_lat : $locations.geo_alt) (Smarty_Compiler.class.php, line 445)
  </code></pre>
  
  <p>My goal is to simply validate if the variable is not empty or not equal to 0. What I did is:</p>
  
  <pre><code>&lt;div class="map_canvas" align="center" id="map_canvas_{$locations.company_id}" style="width: 800px; height: 300px; margin: 10px; border-style: solid; border-color: #0a9ccc" data-company-city="" data-company_id="{$locations.company_id}" data-label="{$locations.company}" data-lat="{if(!$locations.updated_lat ? $locations.updated_lat : $locations.geo_alt)}" data-long="    {if(!$locations.updated_long ? $locations.updated_long : $locations.geo_long)}"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>Here's the part of smarty if statement:</p>
  
  <pre><code>{if(!$locations.updated_lat ? $locations.updated_lat : $locations.geo_alt)}
  </code></pre>
  
  <p>I don't have a problem in data but the if statement is the error. Ok that's all thanks.</p>