Forum Subscriber Support - Joomla Extension - Erweiterungen LLFJ - Lazy Load for Joomla! Printing the images loaded by Lazy Load for Joomla Printing the images loaded by Lazy Load for Joomla
9 Jahre 9 Monate her - 9 Jahre 9 Monate her #9325 von sfg85 As you know, you cannot print the images with lazy loading. I think it would be useful to add an excluding option which will exclude a page
/templates/your_template/COMPONENT.PHP , which was intended as a print version of a document. Unfortunately, there isn't an option for excluding such URLs, generated with this file (you may exclude only whole URL — but it is not convenient), so I had to recode lazyloadforjoomla.php, redefining the function onAfterRender():
public function onAfterRender()
{
$viewRel = explode('?', $_SERVER["REQUEST_URI"]);
$viewRel = $viewRel[1];
if($this->_execute == true && $viewRel != 'tmpl=component&print=1')
{
$blankimage = JURI::base().'plugins/system/lazyloadforjoomla/blank.gif';
$body = JFactory::getApplication()->getBody(false);
$pattern = "@<img[^>]*src=[\"\']([^\"\']*)[\"\'][^>]*>@";
preg_match_all($pattern, $body, $matches);
if($this->params->get('exclude_imagenames') AND !empty($matches))
{
$this->excludeImageNames($matches);
}
if(!empty($matches))
{
foreach($matches[0] as $match)
{
$matchlazy = str_replace('src=', 'src="'.$blankimage.'" data-src=', $match);
$body = str_replace($match, $matchlazy, $body);
}
JFactory::getApplication()->setBody($body);
}
}
} The result you may see
here (there is a print button in the left corner of the article)
However, if I upgrade the version, I will need to change the code again. That's why I would like to ask you to make this option always availible without core editing.
Philip
Dieses Thema wurde gesperrt.
Weniger Mehr Beiträge: 6 Dank erhalten: 0 9 Jahre 9 Monate her #9327 von Viktor Bitte anmelden, um die Antwort zu sehen. Achtung: Eine gültige
Subscription wird benötigt, um einen Account zu aktivieren.
Kubik-Rubik Joomla! Extensions Dieses Thema wurde gesperrt.
Weniger Mehr Beiträge: 7289 Dank erhalten: 775 9 Jahre 9 Monate her #9333 von Viktor Bitte anmelden, um die Antwort zu sehen. Achtung: Eine gültige
Subscription wird benötigt, um einen Account zu aktivieren.
Kubik-Rubik Joomla! Extensions Folgende Benutzer bedankten sich: sfg85
Dieses Thema wurde gesperrt.
Weniger Mehr Beiträge: 7289 Dank erhalten: 775 9 Jahre 9 Monate her #9334 von sfg85 Bitte anmelden, um die Antwort zu sehen. Achtung: Eine gültige
Subscription wird benötigt, um einen Account zu aktivieren.
Dieses Thema wurde gesperrt.
Weniger Mehr Beiträge: 6 Dank erhalten: 0 9 Jahre 9 Monate her #9337 von Viktor Bitte anmelden, um die Antwort zu sehen. Achtung: Eine gültige
Subscription wird benötigt, um einen Account zu aktivieren.
Kubik-Rubik Joomla! Extensions Dieses Thema wurde gesperrt.
Weniger Mehr Beiträge: 7289 Dank erhalten: 775
Forum Subscriber Support - Joomla Extension - Erweiterungen LLFJ - Lazy Load for Joomla! Printing the images loaded by Lazy Load for Joomla
Ladezeit der Seite: 0.171 Sekunden