Jump to content

felix

Members
  • Posts

    214
  • Joined

  • Last visited

  • Days Won

    8

Community Answers

  1. felix's post in Twig PageTableExtended (Flexible Content) was marked as the answer   
    Hi ferraky,
    as I've mentioned: No matter if you set the image field to contain only one image. It will be an array of images (containing one image) in the backend. A post explaining this can be found here.
    Try using "first()" and see if it helps (you can ditch all those ".get()" calls, too):
    {% set data = data == null ? page : data %} <article class="c-component c-content-block" {% if data.color %} style="background-color: {{ data.color }}" {% endif %}> {% for column in data.content_columns %} <div class="c-content-block__column {{ data.collapse_mobile ? 'c-content-block__column--collapse' : '' }}" style="{{ column.width ? "width:" ~ column.width ~ "%;" : "width:50%;" }}"> {% if column.image %} <figure><img src="{{ column.image.first().url }}"></figure> {% endif %} {% if column.content %} {{ column.content }} {% endif %} {% if column.icon %} <span class="c-content-block__icon {{ column.icon }}"></span> {% endif %} </div> {% endfor %} </article>
×
×
  • Create New...