Member
Member
Doctor Kru   11-01-2018, 07:05
#1

Hello!
Trying to introduce lazy loading feature on theme's [i]album.php[/i] for heavy weighted thumbnails. There are a lot of scripts on the net, helping this approach. Examples: b-lazy responsivelyLazy ...
b-lazy uses following html:
[img]data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==[/img]responsivelyLazy:
[img]images/image.jpg srcset=[/img]Both replacing attribute [i]src[/i] with [i]data-src[/i] or [i]srcset[/i] and [i]data-srcset[/i] for lazy needs. How do i use these scripts with ZP functions like [i]printImageThumb()[/i]? Here is the example of lazyload converter for WordPress but howto implement it into Zenphoto?

Administrator
Administrator
acrylian   11-01-2018, 10:46
#2

You can use:

  1. The filters to alter the html (see the user guide, they should be listsed (like standard_image_thumb_html)
  2. You can build your own image fucntions using the underlying object mode respectively the "get" versions of the functions.

Besides, lazy loading will be a built in default feature in the next major release (which sadly is still some time ahead).

Member
Member
Doctor Kru   11-01-2018, 13:24
#3

Oh! very simple.. just made a copy of [i]printImageThumb()[/i] from [i]template-functions.php[/i] to [i]theme/functions.php[/i] added data- to src= attribute, changed the name of the function and its working. Thank you!

Member
Member
sbillard   17-01-2018, 03:44
#4

Would you be interested in a plugin that does this on all images (not just ones done by printimageThumb()? I have produced such a plugin and would be interested in someone willing to test it.

contact me at stephen(@)sbillard.org

Administrator
Administrator
acrylian   17-01-2018, 12:46
#5

If you have a Zenphoto plugin, make it availabe on its own separate GitHub repository for all Zenphoto users to test and use.

Just using our forum for getting feature ideas and testing them - and even requesting private contact – to be included in your separate fork project is neither polite nor welcome. This is the Zenphoto forum and not your fork’s forum.

Anyway, future Zenphoto versions will have this functionality built in.

Member
Member
sbillard   17-01-2018, 18:00
#6

Well, it hasn't been tested well yet. (We feel that thorough testing is important.) That is the reason for asking for someone who is interested to help with the testing.

I am glad that future versions of Zenphoto will have this built in. The list of content for the future version is awesome. So it is just a question of when it will be available. Seems it has been in the pipeline for years now. I assume that is because of the thorough testing you are doing on it.

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.