Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
Integrare la visualizzazione della data di pubblicazione all'interno del modulo di elenco articoli, adattando questa funzionalità a diversi layout utilizzati.

Issue correlata pcrt#81 - pcrt#61
  • Loading branch information
Knock-Out authored Nov 23, 2023
1 parent 8ec3c17 commit 6eee474
Show file tree
Hide file tree
Showing 5 changed files with 275 additions and 184 deletions.
77 changes: 43 additions & 34 deletions html/mod_articles_category/news_gruppi.php
Original file line number Diff line number Diff line change
@@ -1,34 +1,43 @@
<?php

/**
* @package Joomla.Site
* @subpackage mod_articles_category
*
* @copyright (C) 2020 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\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Router\Route;
use Joomla\Component\Content\Site\Helper\RouteHelper;

?>
<?php foreach ($items as $item) : ?>
<div class="card card-bg card-icon card-icon-main rounded mt-3">
<div class="scheda-item">
<?php
$attributes = ['class' => 'mod-news-title ' . $item->active];
$link = htmlspecialchars($item->link, ENT_COMPAT, 'UTF-8', false);
$title = htmlspecialchars($item->title, ENT_COMPAT, 'UTF-8', false);
?>
<h3 class="h6"><?php echo HTMLHelper::_('link', $link, $title, $attributes); ?></h3>
<?php if ($params->get('show_introtext')) : ?>
<p><?php echo $item->displayIntrotext; ?></p>
<?php endif; ?>
</div>
</div>
<?php endforeach; ?>
<?php

/**
* @package Joomla.Site
* @subpackage mod_articles_category
*
* @copyright (C) 2020 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\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Router\Route;
use Joomla\Component\Content\Site\Helper\RouteHelper;

?>
<?php foreach ($items as $item) : ?>
<div class="card card-bg card-icon card-icon-main rounded mt-3">
<div class="scheda-item">
<?php
$attributes = ['class' => 'mod-news-title ' . $item->active];
$link = htmlspecialchars($item->link, ENT_COMPAT, 'UTF-8', false);
$title = htmlspecialchars($item->title, ENT_COMPAT, 'UTF-8', false);
?>
<h3 class="h6"><?php echo HTMLHelper::_('link', $link, $title, $attributes); ?></h3>

<?php if ($params->get('show_introtext')) : ?>
<p><?php echo $item->displayIntrotext; ?></p>
<?php endif; ?>

<!-- Mostra la data di pubblicazione -->
<div class="publication-date mt-2">
<small>
<strong>Pubblicato:</strong> <?php echo JHtml::_('date', $item->publish_up, 'd F Y'); ?>
</small>
</div>

</div>
</div>
<?php endforeach; ?>
137 changes: 71 additions & 66 deletions html/mod_articles_category/news_items.php
Original file line number Diff line number Diff line change
@@ -1,66 +1,71 @@
<?php

/**
* @package Joomla.Site
* @subpackage mod_articles_category
*
* @copyright (C) 2020 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\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Router\Route;
use Joomla\Component\Content\Site\Helper\RouteHelper;
use Joomla\CMS\Uri\Uri;

//print_r($items[0]->parent_title);
//echo $items[0]->parent_id;
//echo $items[0]->parent_language;
//echo $items[0]->parent_title;

$baseImagePath = Uri::root(false) . "media/templates/site/joomla-italia-theme/images/";

?>

<?php foreach ($items as $item) : ?>

<div class="col-12 col-lg-4 pb-3 mb-3">
<div class="card card-bg card-icon rounded h-100">
<div class="card-body">
<div class="card-icon-content d-flex align-items-center">
<div class="card-news-img me-3">


<figure class="figure">
<a href="<?php echo $item->link; ?>" itemprop="url" title="<?php echo $item->title; ?>">
<?php if ((json_decode($item->images)->image_intro) ==''): ?>
<img src="<?= $baseImagePath ?>imgsegnaposto.jpg" class="img-fluid" alt="<?php echo $item->title; ?>">
<?php else: ?>
<img src="<?php echo json_decode($item->images)->image_intro; ?>" class="img-fluid" alt="<?php echo $item->title; ?>" />
<?php endif; ?>
</a>
</figure>

</div>
<a href="<?php echo $item->link; ?>" class="" data-focus-mouse="false">
<div class="blogitem-header">
<p class="mb-0 lh100">
<strong><?php echo $item->title; ?></strong>
</p>
</div>
<?php if ($params->get('show_introtext')) : ?>
<small><?php echo $item->displayIntrotext; ?></small>
<?php endif; ?>
</a>
</div>
</div>
</div>
</div>
<?php endforeach; ?>
<div class="col-12 text-center">
<a href="<?php echo Route::_(RouteHelper::getCategoryRoute($items[0]->parent_id, $items[0]->parent_language)); ?>" class="view-all" title="Vedi tutti"><strong>Vedi tutti</strong></a>
</div>
<?php

/**
* @package Joomla.Site
* @subpackage mod_articles_category
*
* @copyright (C) 2020 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\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Router\Route;
use Joomla\Component\Content\Site\Helper\RouteHelper;
use Joomla\CMS\Uri\Uri;


//print_r($items[0]->parent_title);
//echo $items[0]->parent_id;
//echo $items[0]->parent_language;
//echo $items[0]->parent_title;

$baseImagePath = Uri::root(false) . "media/templates/site/joomla-italia-theme/images/";

?>

<?php foreach ($items as $item) : ?>
<div class="col-12 col-lg-4 pb-3 mb-3">
<div class="card card-bg card-icon rounded h-100">
<div class="card-body">
<div class="card-icon-content d-flex align-items-center">
<div class="card-news-img me-3">
<figure class="figure">
<a href="<?php echo $item->link; ?>" itemprop="url" title="<?php echo $item->title; ?>">
<?php if (empty(json_decode($item->images)->image_intro)) : ?>
<img src="<?= $baseImagePath ?>imgsegnaposto.jpg" class="img-fluid" alt="<?php echo $item->title; ?>">
<?php else : ?>
<img src="<?php echo json_decode($item->images)->image_intro; ?>" class="img-fluid" alt="<?php echo $item->title; ?>" />
<?php endif; ?>
</a>
</figure>
</div>
<div class="article-details">
<a href="<?php echo $item->link; ?>" class="" data-focus-mouse="false">
<div class="blogitem-header">
<p class="mb-2 lh100">
<strong><?php echo $item->title; ?></strong>
</p>
</div>
<?php if ($params->get('show_introtext')) : ?>
<small><?php echo $item->displayIntrotext; ?></small>
<?php endif; ?>
</a>
<!-- Mostra la data di pubblicazione -->
<div class="publication-date mt-2">
<small>
<strong>Pubblicato:</strong> <?php echo JHtml::_('date', $item->publish_up, 'd F Y'); ?>
</small>
</div>
</div>
</div>
</div>
</div>
</div>
<?php endforeach; ?>
<div class="col-12 text-center">
<a href="<?php echo Route::_(RouteHelper::getCategoryRoute($items[0]->parent_id, $items[0]->parent_language)); ?>" class="view-all" title="Vedi tutti"><strong>Vedi tutti</strong></a>
</div>
71 changes: 71 additions & 0 deletions html/mod_articles_category/newsnoveditutti_items.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<?php

/**
* @package Joomla.Site
* @subpackage mod_articles_category
*
* @copyright (C) 2020 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\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Router\Route;
use Joomla\Component\Content\Site\Helper\RouteHelper;
use Joomla\CMS\Uri\Uri;


//print_r($items[0]->parent_title);
//echo $items[0]->parent_id;
//echo $items[0]->parent_language;
//echo $items[0]->parent_title;

$baseImagePath = Uri::root(false) . "media/templates/site/joomla-italia-theme/images/";

?>

<?php foreach ($items as $item) : ?>
<div class="col-12 col-lg-4 pb-3 mb-3">
<div class="card card-bg card-icon rounded h-100">
<div class="card-body">
<div class="card-icon-content d-flex align-items-center">
<div class="card-news-img me-3">
<figure class="figure">
<a href="<?php echo $item->link; ?>" itemprop="url" title="<?php echo $item->title; ?>">
<?php if (empty(json_decode($item->images)->image_intro)) : ?>
<img src="<?= $baseImagePath ?>imgsegnaposto.jpg" class="img-fluid" alt="<?php echo $item->title; ?>">
<?php else : ?>
<img src="<?php echo json_decode($item->images)->image_intro; ?>" class="img-fluid" alt="<?php echo $item->title; ?>" />
<?php endif; ?>
</a>
</figure>
</div>
<div class="article-details">
<a href="<?php echo $item->link; ?>" class="" data-focus-mouse="false">
<div class="blogitem-header">
<p class="mb-2 lh100">
<strong><?php echo $item->title; ?></strong>
</p>
</div>
<?php if ($params->get('show_introtext')) : ?>
<small><?php echo $item->displayIntrotext; ?></small>
<?php endif; ?>
</a>
<!-- Mostra la data di pubblicazione -->
<div class="publication-date mt-2">
<small>
<strong>Pubblicato:</strong> <?php echo JHtml::_('date', $item->publish_up, 'd F Y'); ?>
</small>
</div>
</div>
</div>
</div>
</div>
</div>
<?php endforeach; ?>
<!--<div class="col-12 text-center">
<a href="<?php //echo Route::_(RouteHelper::getCategoryRoute($items[0]->parent_id, $items[0]->parent_language)); ?>" class="view-all" title="Vedi tutti"><strong>Vedi tutti</stonrg></a>
</div>-->
Loading

0 comments on commit 6eee474

Please sign in to comment.