• Hello!

    I’m developing a carousel with slides (amp-img + amp-fit-text), however it’s showing a error:
    “Layout not supported: container. The element did not specify a layout attribute. Check https://www.ampproject.org/docs/guides/responsive/control_layout and the respective element documentation for details”
    <amp-carousel class="i-amphtml-element i-amphtml-layout-container amp-carousel-slide i-amphtml-error" i-amphtml-layout="container"><div class="i-amphtml-scrollable-carousel-container"></div><div tabindex="0" class="amp-carousel-button amp-carousel-button-prev amp-disabled" role="presentation" title="Previous item in carousel" aria-disabled="true"></div><div tabindex="0" class="amp-carousel-button amp-carousel-button-next" role="presentation" title="Next item in carousel" aria-disabled="false"></div></amp-carousel>

    I found out that inside the carousel, it’s rendering one more slide than it’s supposed to:

    <div class="i-amphtml-slide-item">
    <amp-carousel class="i-amphtml-element i-amphtml-layout-container amp-carousel-slide i-amphtml-error" i-amphtml-layout="container">
    <div class="i-amphtml-scrollable-carousel-container"></div>
    <div tabindex="0" class="amp-carousel-button amp-carousel-button-prev amp-disabled" role="presentation" title="Previous item in carousel" aria-disabled="true"></div>
    <div tabindex="0" class="amp-carousel-button amp-carousel-button-next" role="presentation" title="Next item in carousel" aria-disabled="false">
    </div>
    </amp-carousel>
    </div>
    

    this is my code:

    
     <amp-carousel class="carousel1" layout="responsive" height="450" width="500"  type="slides" controls loop >
                    <?php while (have_rows('repeater')) : the_row(); ?>
                        <div class="slide">
                            <amp-img src="<?php echo $img; ?>" alt="alt" width="50" height="50" layout="responsive" class="img-svg img-responsive"></amp-img>
                            <amp-fit-text layout="responsive"
                                width="500"
                                height="150">
                                <p>
                                    <?php echo text; ?>
                                </p>
                            </amp-fit-text>
                        </div>
                    <?php endwhile; ?>  
                <amp-carousel>
    

    Am I doing something wrong?
    Thank you in advance!

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘Carousel Slide Error layout’ is closed to new replies.