So I deleted the modification that I had made in /layouts/partials/grid/entry.php to add the button since it is no longer useful.
I commented in <div class="uk-card-body"> to hide the title:
<!--
<a class="uk-text-large<?php echo $titleClass; ?>" href="https://norrnext.com/<?php echo $href; ?>">
<?php echo $this->escape(CompetitionHelperExtension::truncate($item->title, $titleLength)); ?>
</a>
-->
I deleted in <div class="uk-card-media-top"> to remove the link:
href="https://norrnext.com/<?php echo $href; ?>"
I created a file : download.php in /layouts/default/partials/buttons/
<?php
defined('_JEXEC') or die;
use Joomla\CMS\Router\Route;
// Récupération des données transmises au layout
extract($displayData);
// Construction de l'URL de l'image
$imageUrl = CompetitionHelperExtension::getPhotoUrlPath($item->competition_id, $item->id, CompetitionHelperExtension::getParticipantImage($item), 'l', $cType);
$downloadFileName = basename($imageUrl); // Optionnel, pour spécifier un nom de fichier lors du téléchargement
echo '<a href="https://norrnext.com/' . htmlspecialchars($imageUrl) . '" download="' . htmlspecialchars($downloadFileName) . '" class="nc-share-button uk-button uk-button-default uk-padding-remove uk-width-1-' . $width . '"> <span uk-icon="icon: download"></span> Télécharger </a> </a>';
I changed the actions.php file (To have a different view and display the download button)
<?php
/**
* @package Norr_Competition
* @author Dmitrijs Rekuns <support@norrnext.com>
* @copyright Copyright (C) 2015 - 2024 NorrNext. All rights reserved.
* @license GNU General Public License version 3 or later; see license.txt
*/
\defined('_JEXEC') or die;
use Joomla\CMS\Router\Route;
use Joomla\Registry\Registry;
extract($displayData);
/**
* $displayData
*
* @var string $cType Contest type
* @var boolean $isList Is it a list of entries
* @var object $item Contest entry
* @var Registry $params Contest params
* @var boolean $showVote Display vote button or not
* @var boolean $showShare Display share button or not
*/
// Début du conteneur de grille pour les boutons
echo '<div class="uk-grid-small" uk-grid>'; // Utilise 'uk-grid-small' pour un petit espacement entre les boutons
// Bouton de vote (20%)
if ($showVote) :
echo '<div class="uk-width-1-5">'; // Prend 20% de l'espace
echo CompetitionHelperTheme::renderLayout('buttons.vote', [
'item' => $item,
'params' => $params,
'showShare' => $showShare,
'isList' => $isList
]);
echo '</div>';
endif;
// Bouton de partage (40%)
if ($showShare) :
echo '<div class="uk-width-2-5">'; // Prend également 40% de l'espace
$share = $params->get('share');
if (!empty($share)) :
echo CompetitionHelperTheme::renderLayout('buttons.share', [
'img' => CompetitionHelperExtension::getPhotoUrlPath($item->competition_id, $item->id, CompetitionHelperExtension::getParticipantImage($item), 'l', $cType),
'url' => CompetitionHelperExtension::getRootUrl() . Route::_(CompetitionHelperRoute::getEntryRoute($item->id . ':' . $item->alias, $item->competition_id)),
'title' => $item->title,
'share' => $share,
'showVote' => $showVote,
'isList' => $isList,
'entryId' => $item->id
]);
endif;
echo '</div>';
endif;
// Bouton de téléchargement (40%)
// Affichage direct sans condition
echo '<div class="uk-width-2-5">'; // Prend 40% de l'espace
echo CompetitionHelperTheme::renderLayout('buttons.download', [
'item' => $item,
'cType' => $cType,
'params' => $params,
]);
echo '</div>';
echo '</div>'; // Fin du conteneur de grille
And here is the final result. : https://postimg.cc/N2gdDJrn
Do you see any errors or improvements?