How to include modules in Section/Content Description (for Joomla 1.5.x)? |
| Written by kksou | ||
| Sunday, 20 April 2008 | ||
|
This is in response to Filipe Torres's post titled "How to include modules in section/category description". The standard mosloadposition plugin that comes bundled with the original Joomla 1.5.x installation only allows you to include modules in content items. This article shows you how to include modules in Section/Category description. You can see a live example here. Note: Please refer to the following post in Joomla forum: http://forum.joomla.org/viewtopic.php?p=1295599#p1295599 I think starting Joomla 1.5.3, you do not need the fix as outlined in steps 4 and 5. The section/category description now gets processed by the content plugins by default. Solutions
class ContentViewCategory extends ContentView
{
function display($tpl = null)
{
global $mainframe, $option;
// Initialize some variables
$user =& JFactory::getUser();
$uri =& JFactory::getURI();
$document =& JFactory::getDocument();
$pathway =& $mainframe->getPathway();
$category =& $this->get('Category');
$dispatcher =& JDispatcher::getInstance();
JPluginHelper::importPlugin('content');
$results = $dispatcher->trigger('onBeforeDisplayTitle', array (& $category));
// Get the menu item object
$menus = &JSite::getMenu();
$menu = $menus->getActive();
class ContentViewSection extends ContentView
{
function display($tpl = null)
{
global $mainframe, $option;
// Initialize some variables
$user =& JFactory::getUser();
$document =& JFactory::getDocument();
$section =& $this->get('Section');
$dispatcher =& JDispatcher::getInstance();
JPluginHelper::importPlugin('content');
$results = $dispatcher->trigger('onBeforeDisplayTitle', array (& $section));
// Get the page/component configuration
$params = &$mainframe->getParams();
// Request variables
$limit = JRequest::getVar('limit', $params->get('display_num'), '', 'int');
$limitstart = JRequest::getVar('limitstart', 0, '', 'int');
class ContentViewSection extends ContentView
{
function display($tpl = null)
{
.
.
.
//add alternate feed link
if($params->get('show_feed_link', 1) == 1)
{
$link = '&format=feed&limitstart=';
$attribs = array('type' => 'application/rss+xml', 'title' => 'RSS 2.0');
$document->addHeadLink(JRoute::_($link.'&type=rss'),
'alternate', 'rel', $attribs);
$attribs = array('type' => 'application/atom+xml', 'title' => 'Atom 1.0');
$document->addHeadLink(JRoute::_($link.'&type=atom'),
'alternate', 'rel', $attribs);
}
$dispatcher =& JDispatcher::getInstance();
JPluginHelper::importPlugin('content');
for($i = 0; $i < count($categories); $i++)
{
$category =& $categories[$i];
$category->link = JRoute::_('index.php?view=category&id='.
$category->slug);
$results=$dispatcher->trigger('onBeforeDisplayTitle', array(&$category));
}
if ($total == 0) {
$params->set('show_categories', false);
}
|
||
| < Prev | Next > |
|---|




