我在local.xml中有这个。
<reference name="header">
<block type="core/template" name="wc-customheadblock" template="wc-customheadblock.phtml" />
</reference>
在wc-customheadblock.phtml里面,我有:
<div style="height:100px; background-color:green">
<h1>This is the wc custom head block</h1>
</div>
但是此块没有出现在标题中。我已经对侧边栏进行了相同的尝试(通过更改xml引用名称),并且效果很好。为什么这不适用于标题?
该站点声称可以使用local.xml在标头中添加块!http://www.classyllama.com/development/magento-development/the-better-way-to-modify-magento-layout
转到您的header.phtml文件(app / design / frontend / package / theme / page / html / header.phtml)并放置以下行之一:
<?php echo $this->getChildHtml(); ?>
或者
<?php echo $this->getChildHtml('wc-customheadblock'); ?>
默认情况下,标头很可能不会呈现子块,因为它会导致某些模板崩溃。在侧边栏上,可以在末尾轻松添加额外的孩子。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句