From 17d214a4503a1bdbb85a35194e0823d069f66b73 Mon Sep 17 00:00:00 2001 From: Cameron Date: Sat, 18 Apr 2020 13:38:19 -0700 Subject: [PATCH] Native Lazy loading support added to {NEWS_IMAGE} shortcode. eg. {NEWS_IMAGE: loading=lazy} --- e107_core/shortcodes/batch/news_shortcodes.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/e107_core/shortcodes/batch/news_shortcodes.php b/e107_core/shortcodes/batch/news_shortcodes.php index c956a35d6..44354e392 100644 --- a/e107_core/shortcodes/batch/news_shortcodes.php +++ b/e107_core/shortcodes/batch/news_shortcodes.php @@ -819,7 +819,7 @@ class news_shortcodes extends e_shortcode if(!empty($parm['placeholder'])) { - return $this->sc_newsimage('placeholder'); + return $this->sc_newsimage('placeholder'); } elseif($video = e107::getParser()->toVideo($this->imageItem, array('class'=> 'news-media news-media-'.$parm['item']))) { @@ -987,10 +987,11 @@ class news_shortcodes extends e_shortcode $style = !empty($this->param['thumbnail']) ? $this->param['thumbnail'] : ''; $imgParms = array( - 'class'=>$class, - 'alt'=>basename($srcPath), - 'style'=>$style, - 'placeholder'=>varset($parm['placeholder']) + 'class' => $class, + 'alt' => basename($srcPath), + 'style' => $style, + 'placeholder' => varset($parm['placeholder']), + 'loading' => varset($parm['loading'],'auto'), );