默认添加/调用小部件.TPL布局社交引擎


add/call widget in default.tpl layout socialengine

我是编程和社交引擎方面的新手。我有默认值。TPL布局如下:

  <body id="global_page_<?php echo $identity ?>">
  <div id="global_header">
    <?php echo $this->content('header') ?>
  </div>
  <div id='global_wrapper'>
    <div id='global_content'>
      <div class="new class contain widget">
      </div>
        <?php //echo $this->content('global-user', 'before') ?>
        <?php echo $this->layout()->content ?>
        <?php //echo $this->content('global-user', 'after') ?>
    </div>
  </div>
  <div id="global_footer">
    <?php echo $this->content('footer') ?>
  </div>
  <div id="janrainEngageShare" style="display:none">Share</div>
</body>

我想添加/call小部件并将其放置在<div class="new class contain widget"> </div>标记内。例如,我想添加小部件菜单main和搜索小部件从核心模块在这个html标签内,我怎么能实现这一点?需要你的帮助

这很简单。使用以下代码替换核心。带有小部件名称的菜单主菜单:

<div class="new class contain widget">
    <?php echo $this->content()->renderWidget("core.menu-main"); ?>
</div>