141 lines
		
	
	
		
			4.1 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			141 lines
		
	
	
		
			4.1 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php
 | |
| 
 | |
| /**
 | |
|  * @package     Joomla.Site
 | |
|  * @subpackage  com_content
 | |
|  *
 | |
|  * @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;
 | |
| 
 | |
| /** @var \Joomla\Component\Content\Site\View\Featured\HtmlView $this */
 | |
| 
 | |
| 
 | |
| 
 | |
| use Joomla\CMS\Helper\ModuleHelper;
 | |
| use Joomla\CMS\Language\Text;
 | |
| use Joomla\CMS\Factory;
 | |
| 
 | |
| $ncol = (int) $this->params->get('num_columns');
 | |
| 
 | |
| 
 | |
| 
 | |
| $wa = Factory::getApplication()->getDocument()->getWebAssetManager();
 | |
| 
 | |
| $wa->useStyle('swiper.css.styles', ['position' => 'before']);
 | |
| $wa->useScript('swiper.js.scripts');
 | |
| 
 | |
| 
 | |
| $wa->addInlineScript('
 | |
| window.addEventListener("DOMContentLoaded", function(){
 | |
| 
 | |
| var swiper = new Swiper(".carosellofeatured", {
 | |
|       slidesPerView: 1,
 | |
|       spaceBetween: 10,
 | |
|       loop: true,
 | |
|       navigation: {
 | |
|         nextEl: ".swiper-button-next",
 | |
|         prevEl: ".swiper-button-prev",
 | |
|       },
 | |
|     breakpoints: {
 | |
| 
 | |
|         480: {
 | |
|             spaceBetween: 10,
 | |
|             slidesPerView: 2,
 | |
|         },
 | |
| 
 | |
|         768: {
 | |
|             spaceBetween: 10,
 | |
|             slidesPerView: 3,
 | |
|         },
 | |
| 
 | |
|         1200: {
 | |
|             spaceBetween: 20,
 | |
|             slidesPerView: 4,
 | |
|         },
 | |
| 
 | |
|         1524: {
 | |
|             spaceBetween: 40,
 | |
|             slidesPerView: '.$ncol.',
 | |
|         },
 | |
|       },
 | |
|     });
 | |
| });
 | |
| 
 | |
| ', [], ['type' => 'text/javascript']);
 | |
| 
 | |
| 
 | |
| ?>
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| <div class="featured mt-5">
 | |
|     <?php if ($this->params->get('show_page_heading') != 0) : ?>
 | |
|         <div class="titolo-featured">
 | |
|             <?php echo $this->escape($this->params->get('page_heading')); ?>
 | |
|         </div>
 | |
|     <?php endif; ?>
 | |
|     <div class="container-jit">
 | |
|     <?php if (!empty($this->lead_items)) : ?>
 | |
|         <div class="blog-items items-leading <?php echo $this->params->get('blog_class_leading'); ?>">
 | |
|             <?php foreach ($this->lead_items as &$item) : ?>
 | |
|                 <div class="blog-item">
 | |
|                         <?php
 | |
|                         $this->item = & $item;
 | |
|                         echo $this->loadTemplate('item');
 | |
|                         ?>
 | |
|                 </div>
 | |
|             <?php endforeach; ?>
 | |
|         </div>
 | |
|     <?php endif; ?>
 | |
| 
 | |
|     <?php if (!empty($this->intro_items)) : ?>
 | |
|         <?php $blogClass = $this->params->get('blog_class', ''); ?>
 | |
|         <?php if ((int) $this->params->get('num_columns') > 1) : ?>
 | |
|             <?php $blogClass .= (int) $this->params->get('multi_column_order', 0) === 0 ? ' masonry-' : ' columns-'; ?>
 | |
|             <?php $blogClass .= (int) $this->params->get('num_columns'); ?>
 | |
|         <?php endif; ?>
 | |
| 
 | |
|             <div class="swiper carosellofeatured">
 | |
|                 <div class="swiper-wrapper">
 | |
|                     <?php foreach ($this->intro_items as $key => &$item) : ?>
 | |
|                         <div class="swiper-slide">
 | |
|                             <div class="swiper-content pt-3 pb-5">
 | |
|                                 <?php
 | |
|                                     $this->item = & $item;
 | |
|                                     echo $this->loadTemplate('item');
 | |
|                                 ?>
 | |
|                             </div> 
 | |
|                         </div>
 | |
|                     <?php endforeach; ?>
 | |
|                 </div>  
 | |
|                 <div class="swiper-controls container">
 | |
|                     <div class="swiper-button-next swiper-button-next"></div>
 | |
|                     <div class="swiper-button-prev swiper-button-prev"></div>
 | |
|                 </div>              
 | |
|             </div>
 | |
|     <?php endif; ?>
 | |
| 
 | |
|     <?php if (!empty($this->link_items)) : ?>
 | |
|         <div class="items-more">
 | |
|             <?php echo $this->loadTemplate('links'); ?>
 | |
|         </div>
 | |
|     <?php endif; ?>
 | |
| 
 | |
|     <?php if ($this->params->def('show_pagination', 2) == 1  || ($this->params->get('show_pagination') == 2 && $this->pagination->pagesTotal > 1)) : ?>
 | |
|         <div class="w-100">
 | |
|             <?php if ($this->params->def('show_pagination_results', 1)) : ?>
 | |
|                 <p class="counter float-end pt-3 pe-2">
 | |
|                     <?php echo $this->pagination->getPagesCounter(); ?>
 | |
|                 </p>
 | |
|             <?php endif; ?>
 | |
|             <?php echo $this->pagination->getPagesLinks(); ?>
 | |
|         </div>
 | |
|     <?php endif; ?>
 | |
|     </div>
 | |
| </div>
 |