Hide 'subcategories' title in a blog view

I've seen a number of different articles and suggestions on how to hide subcategories title in a blog view. Some of those suggestions are completely on a wrong track, so I thought to write this article and give several options on how to manage subcategories title in a blog view.

Let's first look at the code below, that displays the subcategories title. This code can be found at the bottom of blog.php, located at the following path \components\com_content\views\category\tmpl

<?php if (!empty($this->children[$this->category->id])&& $this->maxLevel != 0) : ?>
<div class="cat-children">
<?php if ($this->params->get('show_category_heading_title_text', 1) == 1) : ?>
<h3>
<?php echo JTEXT::_('JGLOBAL_SUBCATEGORIES'); ?>
</h3>
<?php endif; ?>
<?php echo $this->loadTemplate('children'); ?>
</div>
<?php endif; ?> 

The above code uses Category Title and Subcategory Levels parameters which can be set in Article Manager Options, under Category tab.

Category Title This will Show or Hide subcategory title, but still list subcategories.

Subcategory Levels will give you control on how many levers of subcategories is displayed. You can also hide the entire section of subcategories by selecting none. This will also hide subcategories title.

subcategories can be changed by overriding JGLOBAL_SUBCATEGORIES by adding a line below to the following file: \language\overrides\en-GB.override.ini

JGLOBAL_SUBCATEGORIES="My Title"

Here is a catch. Not all templates are written equally. Some templates override the code above and my do so in a way that ignores some or all of the rules above. In this case you may need to edit a template you use to manipulate subcategories title. In this case look for a blog.php file which should be located in \templates\YOURTEMPLATE\html\com_content\category\.

Comments   

Erick Boileau
# Erick Boileau 2014-01-17 20:40
in Joomla 3.2 it seems to be in ayouts/joomla/c ontent/category _default.php and no way to modify the code without a core overrides
dvlancer
# dvlancer 2014-01-28 22:30
Have you tired setting "Show Subcategories Text" to hide under a menu's category tab?
Justice Quaye
# Justice Quaye 2014-03-22 19:07
In joomla 3.2, you have to go the global configuration of articles.
Go to the Category Tab and set the Subcategories level to None.
dvlancer
# dvlancer 2014-03-22 21:55
Thank you Justice for sharing this.
Stephen B De Lange
# Stephen B De Lange 2014-03-25 17:38
Joomla 2.5/3x You could always setup a language override in the language manager, just search for subcategories, this is the language snippet you want to override. JGLOBAL_SUBCATE GORIES

 

Would you like to contribute?



Free business joomla templates