SwissUpLabs Logo

Use Cases

Contents

Set image layout

AMP supports a bunch of image layouts.

Our AMP module automatically sets the layout of every image to responsive, except for the small images.

Sometimes you may want to manually set the layout to use for the images inside product description, or some CMS pages.

Here is an example of how to do that and do not affect desktop theme output:

<img src=".." data-tmamp-layout="fixed"/>

Where data-tmamp-layout will be converted in layout attribute, when AMP is active only.

Change image src

Sometimes you may want to use AMP specific image for AMP visitors.

Here is an example of how to do that and do not affect desktop theme:

<img src=".." data-tmamp-src=".."/>

Where data-tmamp-src will override src attribute, when AMP is active.

Change css class name

Available since 1.3.0

Sometimes you may want to change css class name of existing element.

Here is an example of how to do that and do not affect desktop theme:

<ul class="desktop-class-that-will-be-removed" data-tmamp-class="list-unstyled">
    <li>...</li>
</ul>

Where list-unstyled - is a AMP supported css class name.

Edit this Page