Im new to frontity and usually code Wordpress sites in php. Currently i have a repeater field in ACF called ‘service_details’ with sub-fields named ‘icon’ and ‘title’. To output these in a loop i would typically do it as follows:
<?php if(have_rows('service_details')) : ?>
<div>
<ul>
<?php while(have_rows('service_details')) : the_row(); ?>
<li>
<div>
<?php $icon = get_sub_field('icon'); ?>
</div>
<div>
<h3><?php the_sub_field('title'); ?></h3>
</div>
</li>
<?php endwhile; ?>
</ul>
</div>
<?php endif; ?>
I have installed the ACF to Rest API plugin and can get the json which looks like this:
"service_details": [
{
"icon": {
"ID": 6917,
"id": 6917,
"title": "",
"icon": "https://www.mydomain.com/wp-includes/images/media/default.png",
"width": 400,
"height": 400,
},
"title": "Web research & user experience",
},
{
"icon": {
"ID": 6918,
"id": 6918,
"title": "",
"icon": "https://www.mydomain.com/wp-includes/images/media/default.png",
"width": 400,
"height": 400,
},
"title": "Creative website design",
},
{
"icon": {
"ID": 6919,
"id": 6919,
"title": "",
"icon": "https://www.mydomain.com/wp-includes/images/media/default.png",
"width": 400,
"height": 400,
},
"title": "Responsive technical design",
},
{
"icon": {
"ID": 6920,
"id": 6920,
"icon": "https://www.mydomain.com/wp-includes/images/media/default.png",
"width": 400,
"height": 400,
},
"title": "Ongoing website management",
}
],
Is there a way of outputting something similar to the php with frontity?