Fix to distinguish category list titles and descriptions in onContentPrepare callbacks  [#33193]

The layout code in Joomla 3.2 for category lists has an issue.  There is no way for a content plugin to distinguish between the the onContentPrepare(content.prepare) callback for the categoy title and description.  The lay code in layouts/joomla/content/categorydefault.php around lines 35-47 has two calls for 'content.prepare'.  In line 35, there is the call for th etitle:

    <?php echo JHtml::_('content.prepare', $displayData->get('category')->title, '', $extension.'.category'); ?>

Just a bit later (line 47), there is a very similar call for the descrption:

    <?php echo JHtml::_('content.prepare', $displayData->get('category')->description, '', $extension .'.category'); ?>

notice how the calls are identical, except for the raw text being passed as the item.  So if a content plugin wants to modify the description but not the title, there is no way to distinguish between the two.

 

PROPOSED SOLUTION:

What I suggest is that the unused $param field be used in the title invocation to indicate that the item is a title:

    <?php echo JHtml::_('content.prepare', $displayData->get('category')->title, 'title', $extension.'.category'); ?>

See tracker item: http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=33193

-Jonathan