【问题标题】:Magento, Static Block won't render?Magento,静态块不会渲染?
【发布时间】:2014-12-08 21:53:50
【问题描述】:

这是我的 local.xml

<?xml version="1.0" encoding="UTF-8"?>
<layout>
    <default>
        <reference name="root">
            <block type="core/text_list" name="banner" as="banner" translate="label">
                <label>Banner Area</label>
            </block>
        </reference>
        <reference name="bannerblock">
            <block type="core/template" name="bannerblock" template="banner.phtml" />
        </reference>
    </default>
</layout>

这是我的 1column.phtml

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

我不确定为什么它没有被渲染。我认为这可能与 banner.phtml 的放置

有关

我应该输入 应用程序/设计/前端/x/x/模板/
或在里面
应用程序/设计/前端/x/x/模板/页面/html/

洋红色如何发现?

【问题讨论】:

    标签: magento templates block php


    【解决方案1】:

    您从“bannerblock”内部引用“bannerblock”块。尝试将“bannerblock”块声明移动到“根”参考节点:

    <?xml version="1.0" encoding="UTF-8"?>
    <layout>
        <default>
            <reference name="root">
                <block type="core/text_list" name="banner" as="banner" translate="label">
                    <label>Banner Area</label>
                </block>
                <block type="core/template" name="bannerblock" template="banner.phtml" />
            </reference>
        </default>
    </layout>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-07-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-01-13
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多