I am using the Articles - Categories module on my home page (test site). I have Hide Subcategories selected and also maximum level depth = 1, but it still shows all sub categories. In this case, I selected category Resorts and want only two levels, for example Resorts>Jamaica>Hedonism. I have tried every combination of settings. See attached images.


Thanks

Alternately, how do I get the Articles - Category module to display article images? And maybe display like Articles - Categories

    Hi worldet,
    1/ In this case, you selected category Resorts and want only two levels, for example Resorts>Jamaica>Hedonism
    you can open the \templates\ja_tour\html\mod_articles_categories\grid-item.php file and override with the following code:

    <?php
    /**
     * @package     Joomla.Site
     * @subpackage  mod_articles_categories
     *
     * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved.
     * @license     GNU General Public License version 2 or later; see LICENSE.txt
     */
    
    use Joomla\CMS\Factory;
    use Joomla\CMS\HTML\HTMLHelper;
    use Joomla\CMS\Language\Text;
    use Joomla\CMS\Router\Route;
    
    defined('_JEXEC') or die;
    
    $input  = Factory::getApplication()->input;
    $option = $input->getCmd('option');
    $view   = $input->getCmd('view');
    $id     = $input->getInt('id');
    $i 			= 1;
    
    
    $maxLevel = $params->get('maxlevel', 0); // Get the maximum level depth
    
    foreach ($list as $item) : ?>
    
    <?php if ($item->level - $startLevel <= $maxLevel) : ?> <!-- Check the maximum level depth -->
    	
    	<?php
    		$introImage = json_decode($item->params)->image;
    		$bgIntro = '';
    
    		if($introImage) {
    			$bgIntro = 'style="background-image: url('.$introImage.')"';
    		}
    	;?>
    
    	<div class="col-12 col-sm-<?php echo ($i==2) ? '8' : '4' ;?>">
    		<div class="item-wrap">
    			<a href="<?php echo Route::_(ContentHelperRoute::getCategoryRoute($item->id)); ?>" class="bg-intro" <?php echo $bgIntro ;?>></a>
    			<div class="item-inner">
    				<h3>
    					<a href="<?php echo Route::_(ContentHelperRoute::getCategoryRoute($item->id)); ?>">
    					<?php echo $item->title; ?>
    					</a>
    				</h3>
    
    				<?php if ($params->get('show_description', 0)) : ?>
    					<div class="desc">
    						<?php echo HTMLHelper::_('content.prepare', $item->description, $item->getParams(), 'mod_articles_categories.content'); ?>
    					</div>
    				<?php endif; ?>
    
    				<?php if ($params->get('numitems')) : ?>
    				<div class="numitems">
    					<span class="far fa-map"></span> <?php echo $item->numitems.' '.Text::_('TPL_TOURS'); ?>
    				</div>
    				<?php endif; ?>
    			</div>
    
    			<?php if ($params->get('show_children', 0) && (($params->get('maxlevel', 0) == 0)
    				|| ($params->get('maxlevel') >= ($item->level - $startLevel)))
    				&& count($item->getChildren())) : ?>
    				<div class="alert alert-warning">
    					<?php echo Text::_('TPL_NO_SUPPORT_SHOW_CHILDREN'); ?>
    				</div>
    			<?php endif; ?>
    		</div>
    	</div>
    <?php $i++; endif; endforeach; ?>

    Then select maximum level depth = 2.

    2/ About the Articles - Category module, you can open the advanced tab and select the "tours" layout. I think this layout is very nice.

    Write a Reply...
    You need to Login to view replies.