amphtml icon indicating copy to clipboard operation
amphtml copied to clipboard

Using templates using amp-mustache and amp-carousel

Open escoffierdesign opened this issue 10 years ago • 3 comments

The use of the template is up to a specific AMP element that wants to use it. An AMP element would typically look for a template within its children or using a template's ID. For instance, an amp-carousel element may (in the future) use a CORS endpoint and an AMP template to load and render a dynamic set of slides.

<amp-list width=auto
                          height=auto
                          layout=fixed-height
                          src="carousel.json">



                    <template type="amp-mustache" id="amp-template-id">

                        <li>
                            
                          <amp-carousel width="400"
                              height="244"
                              layout="fixed"
                              type="slides"
                              autoplay
                              delay="4000">  

                        <amp-img width="400"
                                 height="244"
                                 layout="fixed"
                                 src="{{src}}"></amp-img>                     


                          </amp-carousel>
                    </li>

                    </template>


                    <div overflow
                         role=button
                         aria-label="Show more"
                         class="list-overflow">
                        Show more
                    </div>
                </amp-list> 

escoffierdesign avatar Nov 09 '16 12:11 escoffierdesign

Is this a question?

jridgewell avatar Nov 09 '16 20:11 jridgewell

It was a statement made on the amp page that explained how the Carousel would evolve.
My question would be..

Has this been implemented.

ie

"An amp-carousel element may (in the future) use a CORS endpoint and an AMP template to load and render a dynamic set of slides"

If not is there a workaround or do we need to wait on the AMP list or AMP Mustache element to be more fully programed..

Thanks for the quick response though.. @jridgewell

@rudygalfi

escoffierdesign avatar Nov 10 '16 12:11 escoffierdesign

Creating a reference from this to the existing thread, and closing as a dupe

ericlindley-g avatar Nov 26 '16 22:11 ericlindley-g