首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >调用静态html的Magento 1.6.2中的right块

调用静态html的Magento 1.6.2中的right块
EN

Stack Overflow用户
提问于 2012-06-23 11:35:54
回答 1查看 476关注 0票数 0

我在magento创建一个CMS页面作为即将到来的产品的预告片。我使用两列和一个右侧栏,并在后端使用布局更新XML来调用我为右侧创建的一些自定义块。

好吧,现在我只是加载占位符,然后在之后编辑phtmls。

如果我使用右边的两个街区,它看起来很好..但是如果我添加更多,那么整个页脚就会损坏并移到右列。

我正在尝试得到3个自定义块在右侧。

下面是我的布局更新XML

代码语言:javascript
复制
<reference name="right">
<block type="newsletter/subscribe" name="left.newsletter" template="newsletter/rightsubscribe.phtml"/>
<block type="core/template" name="name1" template="page/custom/custom1.phtml"/>
<block type="core/template" name="name2" template="page/custom/custom2.phtml"/>
</reference>

这是我正在使用的自定义模块的HTML。

代码语言:javascript
复制
<div id="shop-with-confidence" class="white-box">
    <h3>Custom1</h3>
    <div class="white-box-inner">
         Testing1
    </div>


    <div id="shop-with-confidence" class="white-box">
    <h3>Custom2</h3>
    <div class="white-box-inner">
         Testing2
    </div>

有人知道为什么这会破坏我正在编辑的页面吗?

EN

回答 1

Stack Overflow用户

发布于 2012-06-24 20:05:23

OP已经自己解决了这个问题,但值得注意的是,人们可以很容易地检查父子块关系,以确定问题是与框架相关还是与标记相关。

要检查父块所具有的子块的列表,只需在模板中执行以下操作:

代码语言:javascript
复制
Zend_Debug::dump($this->getChild()) //list of children
Zend_Debug::dump($this->getSortedChildren()) //list of ordered children

在缺少模板(core/text_list,例如"right")的块的情况下,也可以从子块模板执行此操作:

代码语言:javascript
复制
Zend_Debug::dump($this->getParentBlock()->getChild()) //list of children
Zend_Debug::dump($this->getParentBlock()->getSortedChildren()) //list of ordered children

有关详细信息,请参阅Mage_Core_Block_Abstract

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/11166624

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档