Helpdesk is open from Monday through Friday CET

All support tickets are private and they cannot be viewed by anyone. We have made public only a few tickets that we found helpful, after removing private information from them.

For pre-sale questions, please create an (free) account to post a message. Pre-sale tickets are public.

Please check the development versions area. Look at the changelog, maybe your specific problem has been resolved already!

#6582 – wbAMP does not show images with lazy load js script

Posted in ‘Pre-sale questions’
Saturday, 16 March 2019 10:32 UTC
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:

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

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
Floyd611
Saturday, 16 March 2019 10:42 UTC
I apologize for the message entered in the wrong section but I can't move the discussion to the Discuss wbAMP Community edition section
Floyd611
Monday, 18 March 2019 09:20 UTC
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
 
wb_weeblr
Monday, 18 March 2019 10:25 UTC
Hi,
Thanks for the reply.

there is no solution?

Best regards
Floyd611
Monday, 18 March 2019 10:30 UTC
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
 
wb_weeblr
Monday, 18 March 2019 10:42 UTC
Hi,
thanks a lot.
Best regards
Floyd611
Wednesday, 20 March 2019 17:04 UTC
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.
Floyd611
This ticket is closed, therefore read-only. You can no longer reply to it. If you need to provide more information, please open a new ticket and mention this ticket's number.