Hi everyone
in my website, created with joomla, I installed wbAMP plugin + jch optimize plugin.

In the "non-AMP" part of the site, I inserted the images as follows:

<img class = "b-lazy" src = date: image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw== 
data-src = "/path/to/image.png" alt = "Description" />


The b-lazy class is associated with a javascript inserted in the index.php file of the template.

I didn't install any lazy load images plugins for Joomla!

When I view the AMP pages, the images are not displayed.

The images are seen only for the non-AMP site

Is there a solution?

Thank you so much
Responses (6)
  • Accepted Answer

    Saturday, March 16 2019, 10:42 AM - #Permalink
    I apologize for the message entered in the wrong section but I can't move the discussion to the Discuss wbAMP Community edition section
    The reply is currently minimized Show
  • Accepted Answer

    Monday, March 18 2019, 09:20 AM - #Permalink
    Hi

    AMP does not allow any javascript so any form of lazy loading you implement in Joomla will not work on the AMP version of the page.

    Best regards
    The reply is currently minimized Show
  • Accepted Answer

    Monday, March 18 2019, 10:25 AM - #Permalink
    Hi,
    Thanks for the reply.

    there is no solution?

    Best regards
    The reply is currently minimized Show
  • Accepted Answer

    Monday, March 18 2019, 10:30 AM - #Permalink
    Hi

    No direct solution. You must provide an alternative content for the AMP version of the page, using Hid/show tags in your content. See documentation here.

    Best regards
    The reply is currently minimized Show
  • Accepted Answer

    Monday, March 18 2019, 10:42 AM - #Permalink
    Hi,
    thanks a lot.
    Best regards
    The reply is currently minimized Show
  • Accepted Answer

    Wednesday, March 20 2019, 05:04 PM - #Permalink
    Hi everyone
    I did a test as suggested with hide/show tags in non-AMP pages and AMP pages.

    In summary, I wrote this code in the Joomla editor:




    { wbamp-hide start }
    < img class=" class-for-lazy-load-images " src = data : image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw== data-src= "/ path/ to / img.jpg" alt="" width="" height="" />
    { wbamp-hide end }


    { wbamp-show start }
    < img src= " /path/ to / img.jpg " alt="" width="" height="" />
    { wbamp-show end }




    After clearing the cache, I updated the NON AMP pages and the AMP pages.


    The article shows the images with the lazy-load script regularly in the NON AMP pages, and the images without any problems in the AMP pages.

    Thanks you for your suggestion.
    The reply is currently minimized Show
Your Reply