Quantcast
Channel: Adobe Community : Popular Discussions - System Updates
Viewing all articles
Browse latest Browse all 9801

R209 - upcoming updates to the liquid engine

$
0
0

With the R209, to be released next week, we are going to include two updates to our liquid engine that might have an impact on the existing sites.

 

Please find below the list of changes and the possible impact:

  • Ability to render liquid in web app item and product descriptions - this is what is called  deep liquid rendering and will allow you to use liquid login inside the product and web app item descriptions; therefore, with the next release, any liquid code and tags found in the product or web app item description fields will be executed. Moreover, the system does not support both liquid and standard BC tags in these fields  so one will need to choose one or another.
  • Suppress module output - for modules (and currently for liquid) rendered as collections, if you have no items in the the output, the system outputs a hard-coded system strings ("No items found.");  we’ll change that with the next release so that if you use render="collection" and no item is included we’ll actually display the template (and what ever it’s included in the template). See an example below:

 

Let's say we try to capture web app items into a collection to do our own rendering:

{module_webapps id="30021" filter="all" render="collection"}

 

For this web app, the default template contains:

{% assign itemsCount = this.items | size %}
{% if itemsCount > 0 %}
      {% for item in this.items %}
            <h3>{{ item.Name }}</h3>
            <p>{{ item.Description }}</p>
      {% endfor %}
{% else %}
     <p>My very custom message for the case when no item is available</p>
{% endif %}

 

Right now, most of the modules, if no items are found will ignore the template and display a generic "No items found." message. Following the release, the system will execute the template and the resulted output in our example will be:

 

       <p>My very custom message for the case when no item is available</p>

 

Cristinel


Viewing all articles
Browse latest Browse all 9801

Trending Articles