Bug (with fix): category blog includes page heading when only category title requested

16 views
Skip to first unread message

apps

unread,
Dec 17, 2014, 4:34:03 PM12/17/14
to gantry-framew...@googlegroups.com
I was getting double titles on category blog pages after migrating from Joomla! 2.5 to 3.3. I found a report of a similar problem: getting a double title (page heading and category title) when only the latter was requested. The fix is similar: in plugins/system/gantry/overrides/3.3/2.5/com_content/category/blog.php (Gantry 4.1.26), line 26 includes the page heading without checking show_page_heading. So it is included if show_category_title is true and show_page_heading is false.

<?php if ($this->params->get('show_page_heading') != 0 or $this->params->get('show_category_title')): ?>
<h1>
<?php echo $this->escape($this->params->get('page_heading')); ?>
<?php if ($this->params->get('show_category_title'))
{
echo '<span class="subheading-category">'.JHtml::_('content.prepare', $this->category->title, '', 'com_content.category.title').'</span>';
}
?>
</h1>
<?php endif; ?>

Fix:
replace line 26, which reads:
<?php echo $this->escape($this->params->get('page_heading')); ?>
with:
<?php if ($this->params->get('show_page_heading'))
{
echo $this->escape($this->params->get('page_heading'));
}
?>

Reply all
Reply to author
Forward
0 new messages