Joomla在blog.php覆盖中的3个模块


Joomla 3 modules in blog.php override

我已经在我的joomla模板中为blog.php创建了一个覆盖,我想将一些joomla的默认博客模块添加到侧边栏中

我已将代码添加到我的文件中

<div class="blogsidebar">
    <div class="module">
        <jdoc:include type="modules" name="blogarticles" style="custom" />
        <p>&nbsp;</p>
    </jdoc:include></div>
    <div class="module">
        <jdoc:include type="modules" name="blogcategories" style="custom" />
        <p>&nbsp;</p>
    </jdoc:include></div>
</div>

但当我查看源代码时,代码被更改为:

<jdoc:include type="modules" name="blogarticles" style="custom">

它并没有像我所期望的那样呈现出来。即不显示该模块。

我是不是错过了什么?

  • 模块位置在templateDetails.xml中设置
  • 模块存在于模块管理器中并已发布
  • 模块被分配到模块位置
  • 确保以上内容中没有任何拼写错误

感谢

所以。。

<div class="blogsidebar">
    <div class="module">
        <?php
        import('joomla.application.module.helper');
        $module = &JModuleHelper::getModule('Articles Category','blogarticles');
        echo JModuleHelper::renderModule($module);
        ?>
        <p>&nbsp;</p>
    </div>`

[10-Oct-2014 12:27:42 Europe/London] PHP Fatal error: Call to undefined function import() in templates'mytheme'html'com_content'category'blog.php on line 127

[10-Oct-2014 13:14:04 Europe/London] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 36987836 bytes) in 'libraries'joomla'cache'controller'callback.php on line 173

试试这个代码:

$document = &JFactory::getDocument();
$renderer = $document->loadRenderer('modules');
$options = array('style' => 'xhtml');
echo $renderer->render('blogarticles', $options, null);