I want to add the corresponding image of the article in the modules id=168 and 169 sidebar-single position
I want to add the corresponding image of the article in the modules id=168 and 169 sidebar-single position
Hi carlucci,
I have helped you custom the following file:
The code:
<?php
/**
* @package Joomla.Site
* @subpackage mod_articles_latest
*
* @copyright (C) 2006 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
if (!$list) {
return;
}
use Joomla\CMS\Layout\LayoutHelper;
?>
<ul class="mod-articleslatest latestnews mod-list">
<?php foreach ($list as $item) : ?>
<li itemscope itemtype="https://schema.org/Article">
<a href="<?php echo $item->link; ?>" itemprop="url">
<?php echo LayoutHelper::render('joomla.content.intro_image', $item); ?>
<span itemprop="name">
<?php echo $item->title; ?>
</span>
</a>
</li>
<?php endforeach; ?>
</ul>
<?php
/**
* @package Joomla.Site
* @subpackage mod_articles_popular
*
* @copyright (C) 2006 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
if (!isset($list)) {
if (isset($hitsDisabledMessage)) {
echo $hitsDisabledMessage;
}
return;
}
use Joomla\CMS\Layout\LayoutHelper;
?>
<ul class="mostread mod-list">
<?php foreach ($list as $item) : ?>
<li itemscope itemtype="https://schema.org/Article">
<a href="<?php echo $item->link; ?>" itemprop="url">
<?php echo LayoutHelper::render('joomla.content.intro_image', $item); ?>
<span itemprop="name">
<?php echo $item->title; ?>
</span>
</a>
</li>
<?php endforeach; ?>
</ul>
/****Custom Latest + Popular module*****/
.latestnews li,
.mostread li {
clear: both;
}
ul.mod-articleslatest figure.pull-left img,
.mostread li figure.item-image img {
width: 120px;
}
It works fine except your css code.
I have removed your code, it works the same with or without code.
Each image begins with a ">" sign. This, perhaps, is due to the "li""?