can';t将内容块移动到标题Magento
我是新马根托。我试着围绕结构块和内容块进行游戏。当我尝试将“我的购物车”块从右侧移动到标题部分时。它不起作用。但一旦我移动了另一个街区,它就会起作用。例:can';t将内容块移动到标题Magento,magento,Magento,我是新马根托。我试着围绕结构块和内容块进行游戏。当我尝试将“我的购物车”块从右侧移动到标题部分时。它不起作用。但一旦我移动了另一个街区,它就会起作用。例: <reference name="header"> <block type="checkout/cart_sidebar" name="cart_sidebar" template="checkout/cart/sidebar.phtml" before="-"> <
<reference name="header">
<block type="checkout/cart_sidebar" name="cart_sidebar" template="checkout/cart/sidebar.phtml" before="-">
<action method="addItemRender"><type>simple</type><block>checkout/cart_item_renderer</block><template>checkout/cart/sidebar/default.phtml</template></action>
<action method="addItemRender"><type>grouped</type><block>checkout/cart_item_renderer_grouped</block><template>checkout/cart/sidebar/default.phtml</template></action>
<action method="addItemRender"><type>configurable</type><block>checkout/cart_item_renderer_configurable</block><template>checkout/cart/sidebar/default.phtml</template></action>
<block type="core/text_list" name="cart_sidebar.extra_actions" as="extra_actions" translate="label" module="checkout">
<label>Shopping Cart Sidebar Extra Actions</label>
</block>
</block>
</reference>
您必须通过以下方式手动渲染块:
<?php echo $this->getChildHtml('extra_actions'); ?>
在购物车phtml模板文件中
Header、head和cart块不是核心/文本列表块,这意味着它们不会自动呈现其子项谢谢!!!:)我现在可以展示了。但是为什么有些块是核心/文本列表,但需要手动渲染,例如只有核心/文本列表块自动渲染其子块,所有其他块都需要调用getChildHtml方法您所说的head reference。。就简单的html而言,如果您将cart块放在html标记中,那么您将无法在浏览器中看到任何呈现的内容。希望你能理解。head引用主要是注入js和css文件。