Search code examples
htmlamp-html

On AMP pages should amp-carousel elements have a lightbox attribute or not?


I'm getting different conflicting AMP validation messages..

When I add a lightbox attribute to an amp-carousel element I get the following validation message.

The attribute 'lightbox' may not appear in tag 'amp-carousel'

But if I remove it, I get the following validation message..

The mandatory attribute 'lightbox' is missing in tag 'AMP-CAROUSEL. [lightbox]'

It feels like the AMP validator can't make up its mind.

I'm using this url. https://leasing.com/car-leasing-news/2018-mercedes-s-class-coupe-cabriolet/amp/

on the following validator..

https://search.google.com/test/amp


Solution

  • You have missed amp-lightbox-gallery-0.1.js to add in header

    <script async custom-element="amp-lightbox-gallery" src="https://cdn.ampproject.org/v0/amp-lightbox-gallery-0.1.js"></script>
    

    After adding js screen shot

    enter image description here

    Before

    enter image description here