New answers tagged

3

In the second inner loop, you need to add the number of items in the first panel to the current index to get a consistent count. Might be an off-by-one-error in the following example, make sure to adjust for your desired output … {% set panel_one_items = block.nt_panel_one.all() %} {% set panel_two_items = block.nt_panel_two.all() %} {% for item in ...


2

Maybe you can try like this, attribute you seek is twig function not from the craft entry value. {% for i in 1..5 %} {% set field = attribute(entry,'fieldName' ~ i) %} {% if field is defined and field|length %} … {% endif %} {% endfor %}


Top 50 recent answers are included