Liquid, JavaScript, themes, sales channels
I've built the following liquid for loop to retrieve & output data from a repeating advanced custom field in Shopify. The ACF namespace is faq, and contains heading and content data. My current loop is as follows:
<div class="feed-faqs"> {% if page.metafields.faq != blank %} {% assign faqs = page.metafields.faq %} {% for item in faqs %} {% assign i = forloop.index %} <div class="item item--{{ i }}"> {{ heading[i] }} {{ content[i] }} </div> {% endfor %} {% endif %} </div>
However, on the frontend, this loop returns the following:
<div class="feed-faqs"> <div class="item item--1"> </div> <div class="item item--2"> </div> </div>
Is what I'm trying to achieve (to output multiple values from a repeating ACF field) possible with this approach, and if so, where have I gone wrong in fetching the header & content data?
Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024Digital marketers and app developers have tracked activity in apps and websites for yea...
By Ollie Mar 13, 2024February was an exciting month with Shopify Editions, informative webinars, and more! F...
By JasonH Mar 7, 2024