This Joomla 4 override displays in a table (Bootstrap component), a list of best deals with: the name of the provider, a summary of the offer, the ending date and a button to see the deal. All you have to do is to create an article category and create an article for each new offer. The module will manage the display for you. At the bottom of this article, you can download the files of the override.
Joomla 4 frontend rendering
PhP markup
<?php
/**
* @package Joomla.Site
* @subpackage mod_articles_category
* @Author web-eau.net
* @copyright (C) 2010 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\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Associations;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\FileLayout;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Uri\Uri;
use Joomla\Component\Content\Administrator\Extension\ContentComponent;
use Joomla\Component\Content\Site\Helper\RouteHelper;
use Joomla\Component\Fields\Administrator\Helper\FieldsHelper;
if (!$list) {
return;
}
?>
<div class="table-responsive shadow">
<table class="table table-bordered table-hover">
<thead>
<tr class="alert alert-primary">
<th class="ps-3 fw-bold fs-5" scope="col">Provider</th>
<th class="text-center fw-bold fs-5" scope="col">Offer</th>
<th class="text-center fw-bold fs-5" scope="col">Ending</th>
<th class="text-center fw-bold fs-5" scope="col">Deal</th>
</tr>
</thead>
<tbody>
<?php $items = $list; ?>
<?php foreach ($items as $item) : ?>
<tr>
<?php $urls = json_decode($item->urls, true);?>
<td class="ps-3 py-3">
<a target="_blank" class="text-primary fw-bold" href="<?php echo $urls['urla'];?>"><?php echo $urls['urlatext'];?></a>
</td>
<td class="py-3 text-center">
<?php echo $item->title; ?>
</td>
<td class="py-3 text-center">
<div class="published">
<time datetime="<?php echo HTMLHelper::_('date', $displayData['item']->publish_down, 'c'); ?>" itemprop="datePublished">
<?php echo JHtml::_('date', $item->publish_down, 'd-m'); ?>
</time>
</div>
</td>
<?php if ($params->get('show_introtext')) : ?>
<p class="mod-articles-category-introtext">
<?php echo $item->displayIntrotext; ?>
</p>
<?php endif; ?>
<td class="py-3 pe-3 text-center">
<a target="_blank" title="Get this Joomla Deal now!" class="btn btn-sm btn-primary text-white" href="<?php echo $urls['urla'];?>">Shop Now</a>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>