title: How to add conditional elements in data-sly-list?
body: <p>I currently have a data-sly-list that populates a JS array like this:</p>
  
  <pre><code>          var infoWindowContent = [
                &lt;div data-sly-use.ed="Foo"
                     data-sly-list="${ed.allassets}"
                     data-sly-unwrap&gt;
                     ['&lt;div class="info_content"&gt;' +
                     '&lt;h3&gt;${item.assettitle @ context='unsafe'}&lt;/h3&gt; ' +
                     '&lt;p&gt;${item.assettext @ context='unsafe'} &lt;/p&gt;' + '&lt;/div&gt;'],
                 &lt;/div&gt;
                 ];
  </code></pre>
  
  <p>I need to add some logic into this array. If the <code>assetFormat</code> property is 'text/html' only then I want to print the <code>&lt;p&gt;</code> tag. If the <code>assetFormat</code> property is <code>image/png</code> then I want to print <code>img</code> tag. </p>
  
  <p>I'm aiming for something like this. Is this possible to achieve?</p>
  
  <pre><code>          var infoWindowContent = [
                &lt;div data-sly-use.ed="Foo"
                     data-sly-list="${ed.allassets}"
                     data-sly-unwrap&gt;
                     ['&lt;div class="info_content"&gt;' +
                     '&lt;h3&gt;${item.assettitle @ context='unsafe'}&lt;/h3&gt; ' +
                     if (assetFormat == "image/png")
                         '&lt;img src="${item.assetImgLink}&lt;/img&gt;'
                     else if (assetFormat == "text/html")
                         '&lt;p&gt;${item.assettext @ context='unsafe'}&lt;/p&gt;'
                     + '&lt;/div&gt;'],
                 &lt;/div&gt;
                 ];
  </code></pre>