getIdentity();
$show_description = $this->params->get('show_description', 1);
@@ -48,6 +49,22 @@
$description = HTMLHelper::_('string.truncate', StringHelper::substr($full_description, $start), $desc_length, true);
}
+$showImage = $this->params->get('show_image', 0);
+
+if ($showImage && !empty($this->result->imageUrl))
+{
+ $imageclass = $this->params->get('image_class', '');
+ $image = HTMLHelper::cleanImageURL($this->result->imageUrl);
+ $extraAttr = '';
+
+ // Set lazyloading only for images which have width and height attributes
+ if ((isset($image->attributes['width']) && (int) $image->attributes['width'] > 0)
+ && (isset($image->attributes['height']) && (int) $image->attributes['height'] > 0))
+ {
+ $extraAttr = ArrayHelper::toString($image->attributes) . ' loading="lazy"';
+ }
+}
+
$icon = '';
if (!empty($this->result->mime)) :
$icon = ' ';
@@ -59,6 +76,23 @@
endif;
?>
+
+
+ params->get('link_image') && $this->result->route) : ?>
+
+
+ />
+
+
+
+ />
+
+
+
result->route) : ?>
title = $title;
}
+ $images = $item->images ? json_decode($item->images) : false;
+
+ // Add the image.
+ if ($images && !empty($images->image_intro))
+ {
+ $item->imageUrl = $images->image_intro;
+ $item->imageAlt = $images->image_intro_alt ?? '';
+ }
+
// Add the meta author.
$item->metaauthor = $item->metadata->get('author');