【问题标题】:Magento - Adding to the LayoutMagento - 添加到布局
【发布时间】:2010-02-07 18:08:29
【问题描述】:

我的一个布局文件中有此部分:

<blog_post_view>
    <reference name="content">
        <block type="blog/post" name="post" template="aw_blog/post.phtml" />
        <block type="socialbookmarking/bookmarks" name="bookmarks" template="bookmarks/bookmarks.phtml"/>
    </reference>
</blog_post_view>

第一个块显示一个帖子,第二个块显示一些社交书签图标。问题是显示帖子的部分还显示“添加 cmets”部分。我想在帖子和 cmets 之间添加社交图标。

我该怎么做? IE。在 Post 块中间添加 Social 块?

谢谢!

【问题讨论】:

    标签: magento


    【解决方案1】:

    改成:

    <blog_post_view>
        <reference name="content">
            <block type="blog/post" name="post" template="aw_blog/post.phtml">
                <block type="socialbookmarking/bookmarks" name="bookmarks" template="bookmarks/bookmarks.phtml"/>
            </block>
        </reference>
    </blog_post_view>
    

    然后在帖子模板 (aw_blog/post.phtml) 中将以下内容放在您希望书签出现的位置:

    <?php echo $this->getChildHtml('bookmarks'); ?>
    

    【讨论】:

      猜你喜欢
      • 2012-09-03
      • 2011-08-13
      • 2014-08-23
      • 2022-12-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-11-26
      • 2014-08-29
      相关资源
      最近更新 更多