<?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;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;

?>
<ul class="latestnews <?php echo $moduleclass_sfx; ?> mod-list">
<?php foreach ($list as $item) : ?>
	<li itemscope itemtype="https://schema.org/Article">
		<?php
			// Intro Image
			$introImage = json_decode($item->images)->image_intro;
		?>
		<!-- Intro Image -->
		<?php if($introImage) : ?>
			<div class="intro-image">
				<img src="<?php echo $introImage ;?>" alt="<?php echo $item->title; ?>" />
			</div>
		<?php endif ;?>

		<div class="box-content">
			<h4 class="title"><a href="<?php echo $item->link; ?>" itemprop="url">
				<span itemprop="name">
					<?php echo $item->title; ?>
				</span>
			</a></h4>

			<div class="article-info">
				<dd class="published">
	                <span><?php echo HTMLHelper::_('date', $item->created, Text::_('F j, Y')); ?></span>
	            </dd>

	            <dd class="hits">
	            	<i class="fas fa-eye"></i>
					<span><?php echo $item->hits; ?></span>
	            </dd>
			</div>
		</div>
	</li>
<?php endforeach; ?>
</ul>
