How can I use a repeat in AMP carousel

133 Views Asked by At

I have an AMP-LIST which includes a few items, each item has some properties. One of these properties is an array of Images that is supposed to be used inside an AMP-CAROUSEL. Something like this scheme:

    <amp-list src="A/JSON/URL">
        <h2>{{somthing}}</h2>
        <p>{{somthing}}</p>
        <amp-carousel>
             ** AN ARRAY IS NEEDED TO BE RENDERED INSIDE HERE**
        </amp-carousel>
    </amp-list>

How can I render the IMAGES array which is part of ITEMS array inside the carousel for every item

{
  items: [
    {
       prop:value1,
       images:['image1URL','image2URL','image3URL',....],
    },

    {
       prop:value2,
       images:['image4URL','image5URL',....],
    },
  ]
}
1

There are 1 best solutions below

0
On

*** Problem Solved : It's an AMP-HTML project by the way. And I managed to get the results by changing the html code to this:

    <amp-list src="A/JSON/URL">
        <h2>{{somthing}}</h2>
        <p>{{somthing}}</p>
        <amp-carousel>
             {{#TheImageArray}}
                 <img src={{theURL}} />
             {{/TheImageArray}}
        </amp-carousel>
    </amp-list>