unsaturated / grav-plugin-lazy-image Goto Github PK
View Code? Open in Web Editor NEWGrav CMS plugin that defers loading your page's images until they are scrolled into view.
License: MIT License
Grav CMS plugin that defers loading your page's images until they are scrolled into view.
License: MIT License
Does this plugin support images found within a Twig template? The plugin appears to successfully replace images found within page.content
but not the template itself.
I ended up with the same error as displayed here when I installed this on my dev environment. Didn't push it to production as a result.
Sadly, this mysteriously cleared up and wasn't truly resolved. I've tried the suggestions they had here, but with no luck. Sorry.
The current grav-plugin-lazy-image/vendor/composer/autoload_real.php
has the following class declaration
class ComposerAutoloaderInit8a23e2ae4d3f41dc1f0d10df35e696c7
This generates a GravCMS error
Removing the reference 8a23e2ae4d3f41dc1f0d10df35e696c7
in the entire file allows the system to work again
I receive an error when opening a blog page (blog-listing) when the Lazy Image plugin is enabled. This is the same error that was fixed back in april, reference: #5
Grav v1.5.1
Admin v1.8.9
Gantry 5 Framework v5.4.26
Lazy Image v1.0.3
Error stack trace below:
[2018-09-26 16:03:33] grav.CRITICAL: An exception has been thrown during the rendering of a template ("DiDom\Document::load expects parameter 4 to be integer, string given"). - Trace: #0 /var/www/krakengroup.org/public_html/krakeninbound/vendor/twig/twig/lib/Twig/Template.php(403): Twig_Template->displayWithErrorHandling(Array, Array) #1 /var/www/krakengroup.org/public_html/krakeninbound/cache/twig/3c/3ca8d9de8de13fdace552e789e321f5075523efc681fb9d1d4adca9d95ffe131.php(318): Twig_Template->display(Array) #2 /var/www/krakengroup.org/public_html/krakeninbound/vendor/twig/twig/lib/Twig/Template.php(215): __TwigTemplate_c2863d1e5c57271abffb90b14d4fca1e6358e45637cf8c6a16e252bb6594ec75->block_content(Array, Array) #3 /var/www/krakengroup.org/public_html/krakeninbound/cache/twig/d9/d978b72614e6b8b1c3a13c5e37b7a7db0628980220795b058bff2482bdd728eb.php(44): Twig_Template->displayBlock('content', Array, Array) #4 /var/www/krakengroup.org/public_html/krakeninbound/vendor/twig/twig/lib/Twig/Template.php(432): __TwigTemplate_fee1dfe87f3c9d1fa6c3fa7910b481914b3fae184ec85a7592ea98db0e17f592->doDisplay(Array, Array) #5 /var/www/krakengroup.org/public_html/krakeninbound/vendor/twig/twig/lib/Twig/Template.php(403): Twig_Template->displayWithErrorHandling(Array, Array) #6 /var/www/krakengroup.org/public_html/krakeninbound/cache/twig/67/6744bf45b44991c81e09b397a7bdd6a2b23e56ab1646143bc76c34e6a1c41f0a.php(24): Twig_Template->display(Array, Array) #7 /var/www/krakengroup.org/public_html/krakeninbound/vendor/twig/twig/lib/Twig/Template.php(432): __TwigTemplate_8e17aa7436d9b1e5f991fb419935a9d532587dfc9088cd7a91ae9bd4d23f6195->doDisplay(Array, Array) #8 /var/www/krakengroup.org/public_html/krakeninbound/vendor/twig/twig/lib/Twig/Template.php(403): Twig_Template->displayWithErrorHandling(Array, Array) #9 /var/www/krakengroup.org/public_html/krakeninbound/cache/twig/3c/3ca8d9de8de13fdace552e789e321f5075523efc681fb9d1d4adca9d95ffe131.php(27): Twig_Template->display(Array, Array) #10 /var/www/krakengroup.org/public_html/krakeninbound/vendor/twig/twig/lib/Twig/Template.php(432): __TwigTemplate_c2863d1e5c57271abffb90b14d4fca1e6358e45637cf8c6a16e252bb6594ec75->doDisplay(Array, Array) #11 /var/www/krakengroup.org/public_html/krakeninbound/vendor/twig/twig/lib/Twig/Template.php(403): Twig_Template->displayWithErrorHandling(Array, Array) #12 /var/www/krakengroup.org/public_html/krakeninbound/vendor/twig/twig/lib/Twig/Template.php(411): Twig_Template->display(Array) #13 /var/www/krakengroup.org/public_html/krakeninbound/vendor/twig/twig/lib/Twig/Environment.php(363): Twig_Template->render(Array) #14 /var/www/krakengroup.org/public_html/krakeninbound/system/src/Grav/Common/Twig/Twig.php(354): Twig_Environment->render('blog_list.html....', Array) #15 /var/www/krakengroup.org/public_html/krakeninbound/system/src/Grav/Common/Service/OutputServiceProvider.php(27): Grav\Common\Twig\Twig->processSite('html') #16 /var/www/krakengroup.org/public_html/krakeninbound/vendor/pimple/pimple/src/Pimple/Container.php(118): Grav\Common\Service\OutputServiceProvider->Grav\Common\Service\{closure}(Object(Grav\Common\Grav)) #17 /var/www/krakengroup.org/public_html/krakeninbound/system/src/Grav/Common/Processors/RenderProcessor.php(19): Pimple\Container->offsetGet('output') #18 /var/www/krakengroup.org/public_html/krakeninbound/system/src/Grav/Common/Grav.php(131): Grav\Common\Processors\RenderProcessor->process() #19 /var/www/krakengroup.org/public_html/krakeninbound/system/src/Grav/Common/Grav.php(370): Grav\Common\Grav->Grav\Common\{closure}() #20 [internal function]: Grav\Common\Grav::Grav\Common\{closure}('render', 'Render', Object(Closure)) #21 /var/www/krakengroup.org/public_html/krakeninbound/system/src/Grav/Common/Grav.php(346): call_user_func_array(Object(Closure), Array) #22 /var/www/krakengroup.org/public_html/krakeninbound/system/src/Grav/Common/Grav.php(132): Grav\Common\Grav->__call('measureTime', Array) #23 /var/www/krakengroup.org/public_html/krakeninbound/index.php(52): Grav\Common\Grav->process() #24 {main} [] []
Lazysizes is a bit larger, but it does consider other usecases, like carousels. I switched the library from the plugin and it works great
I've got this error today:
DiDom\Document::load expects parameter 4 to be integer, string given
I was uploading website to production
23
InvalidArgumentException
…/user/plugins/lazy-image/vendor/imangazaliev/didom/src/DiDom/Document.php 222
22
DiDom\Document load
…/user/plugins/lazy-image/vendor/imangazaliev/didom/src/DiDom/Document.php 56
21
DiDom\Document __construct
…/user/plugins/lazy-image/lazy-image.php 115
20
Grav\Plugin\LazyImagePlugin updateImages
…/user/plugins/lazy-image/lazy-image.php 89
Consider checking for data-src
before execution of lines 118
to 123
on lazy-image.php
I did this change and now the plugins works for both images on markdown and on the template.
hello everyone,
if I activate the plugin no twig will be executed within pages anymore.
For Example an
<ahref='{{ base_url }}'></a>
results then as
%7B%7B%20base_url%20%7D%7D.
if I deactivate the plugin again, twig is executed normally again.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.