3
votes

I would like to show the subcategory title in Joomla 3.3 category blog page. Got a following suggestion from a link and put it in the blog.php file like : /templates/mytemplate/html/com_content/category/blog.php

<?php 
$this->item = &$item;
$subcat = $this->item->category_title;
if ($subcat != $psubcat) :
echo "<h2>" . $subcat . "</h2>";
endif;
$psubcat = $subcat;
?> 

Normally this code is working except when we set the leading item 1. I have tried to set foreach condition before and after the code something like:

<?php foreach ($this->lead_items as &$item) : ?>

but its not working when we set lead items 1 or more on Category blog layout. So is there any way to show the subcategory title in Joomla Category blog layout or what kind of modification i need to put in the above code to make it work?

1
Please ask your question on the dedicated Joomla Stack Exchange site ;) - Lodder
Did you get an answer to this... - j00m

1 Answers

0
votes

There are 2 places you will need to add the above code to (in the blog.php file), one in the block of code displaying the lead_items:

<?php if (!empty($this->lead_items)) : ?>

And the second in the block code displaying intro items:

<?php if (!empty($this->intro_items)) : ?>