我在magento创建一个CMS页面作为即将到来的产品的预告片。我使用两列和一个右侧栏,并在后端使用布局更新XML来调用我为右侧创建的一些自定义块。
好吧,现在我只是加载占位符,然后在之后编辑phtmls。
如果我使用右边的两个街区,它看起来很好..但是如果我添加更多,那么整个页脚就会损坏并移到右列。
我正在尝试得到3个自定义块在右侧。
下面是我的布局更新XML
<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。
<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>有人知道为什么这会破坏我正在编辑的页面吗?
发布于 2012-06-24 20:05:23
OP已经自己解决了这个问题,但值得注意的是,人们可以很容易地检查父子块关系,以确定问题是与框架相关还是与标记相关。
要检查父块所具有的子块的列表,只需在模板中执行以下操作:
Zend_Debug::dump($this->getChild()) //list of children
Zend_Debug::dump($this->getSortedChildren()) //list of ordered children在缺少模板(core/text_list,例如"right")的块的情况下,也可以从子块模板执行此操作:
Zend_Debug::dump($this->getParentBlock()->getChild()) //list of children
Zend_Debug::dump($this->getParentBlock()->getSortedChildren()) //list of ordered children有关详细信息,请参阅Mage_Core_Block_Abstract。
https://stackoverflow.com/questions/11166624
复制相似问题