Answer the question
In order to leave comments, you need to log in
Is there a way to decompose an array into variables in a Twig template?
Is it possible to do something similar to how in PHP an array is decomposed into variables in Twig?
$info = array('кофе', 'коричневый', 'кофеин');
list($drink, $color, $power) = $info;
{% for photo in tour.get_field('photos') %}
{% set photo = photo.photo %}
{% if photo != "" %}
<img data-lazy='{{photo}}'>
{% endif %}
{% endfor %}
Answer the question
In order to leave comments, you need to log in
1. Expand in PHP and put into a separate element in $context?
2. Use some ACF filters to return as needed? https://www.advancedcustomfields.com/resources/acf... I think it can.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question