在joomla中,如何将模块位置置于类别视图覆盖范围内?

lbw*_*web 3 php joomla

我正在为类别博客视图创建一个覆盖,我希望在此布局中有一个模块位置.那么,是否可以放置

<jdoc:include type="modules" name="modName" style="none" />
Run Code Online (Sandbox Code Playgroud)

在templates/template/html/com_content/category/blog.php中还是需要不同的代码?

小智 9

使用:

<?php
$document = JFactory::getDocument();
$renderer = $document->loadRenderer('modules');
$position = "YOURPOSITIONNAME";
$options = array('style' => 'raw');
echo $renderer->render($position, $options, null);
?>
Run Code Online (Sandbox Code Playgroud)

资料来源:http://www.jeepstone.co.uk/2012/07/26/load-module-position-in-template-override-in-joomla-2-5/

文章写了Joomla 2.5,但我在Joomla的文章视图覆盖中测试了它!3.3.6它也有效.