dongpi3237 2015-02-05 11:54
浏览 95

自定义页面上的Joomla模块

I created a component in my Joomla website theme folder, like so:

/templates/rt_afterburner/html/com_content/article

By custom page, I mean an Alternate Layout for an article. I copied the Default.php file and edited it.

Then I created a php file and that is all working correctly.

I am trying to get this "latest news" module from the homepage on my page but I am not sure what I have to call to render this.

<div id="latestnews" class="highlightblock single"><jdoc:include type="modules" name="fp_latestnews" style="xhtml" /></div>

I have tried coping over the module files to where my php file is and included:

$app = JFactory::getApplication(); 

But I can't seem to get this to work.

  • 写回答

1条回答 默认 最新

  • doudihuang7642 2015-02-15 12:55
    关注

    You could load a module in a layout override file using JModuleHelper/renderModule method.

    jimport( 'joomla.application.module.helper' );
    $module = JModuleHelper::getModule( 'mainmenu', 'Key Concepts' );
    $attribs['style'] = 'xhtml';
    echo JModuleHelper::renderModule( $module, $attribs );
    

    Reference: JModuleHelper/renderModule

    评论

报告相同问题?

悬赏问题

  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?