?
avatar LaurensGoedel
LaurensGoedel
23 Sep 2015

Steps to reproduce the issue

  1. Create a category
  2. Create a menu-item linking to that category as blog for instance
  3. Create a categories module with the same category and visible on the just created menu item
  4. Do not enable SEF in your Joomla configuration

Expected result

The li element with the same category should have a 'active'-class

Actual result

Because of the difference in $_SERVER['REQUEST_URI'] and the ContentHelperRoute::getCategoryRoute in HTML characters, the li-element does not get the class 'active'.

Possible solution

File /modules/mod_articles_categories/tmp/default_items.php, replace the if-statement on ~ 13
Add:

$activeCatId = '';
if(JFactory::getApplication()->input->get('view') === 'category' )
{
    $activeCatId = JFactory::getApplication()->input->get('id');
}

And replace

<li <?php if ($_SERVER['REQUEST_URI'] == JRoute::_(ContentHelperRoute::getCategoryRoute($item->id))) echo ' class="active"';?>> <?php $levelup = $item->level - $startLevel - 1; ?>

with:

<li <?php if (!empty($activeCatId) && $activeCatId == $item->id) echo ' class="active"';?>> <?php $levelup = $item->level - $startLevel - 1; ?>
avatar LaurensGoedel LaurensGoedel - open - 23 Sep 2015
avatar zero-24 zero-24 - change - 23 Sep 2015
Category Front End Modules
avatar zero-24
zero-24 - comment - 23 Sep 2015

Hi @LaurensGoedel can you send your fixes as patch against staging? If you need help see: https://docs.joomla.org/Using_the_Github_UI_to_Make_Pull_Requests


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/7935.

avatar zero-24 zero-24 - change - 23 Sep 2015
Labels Added: ?
avatar brianteeman brianteeman - change - 20 Mar 2016
Category Front End Modules Front End Modules Router / SEF
avatar brianteeman
brianteeman - comment - 11 May 2016

This module displays a list of categories from one parent category.

In your example above you are in the parent category so it is not expected that it will display the name of that category. It is only intended to display any subcategories


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/7935.

avatar brianteeman brianteeman - change - 11 May 2016
Status New Expected Behaviour
Closed_Date 0000-00-00 00:00:00 2016-05-11 09:51:50
Closed_By brianteeman
avatar brianteeman brianteeman - close - 11 May 2016
avatar brianteeman brianteeman - close - 11 May 2016
avatar brianteeman
brianteeman - comment - 11 May 2016

Closed as expected behaviour


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/7935.

Add a Comment

Login with GitHub to post a comment