我有这段代码 XML:
<block type="page/html_footer" name="footer" as="footer" template="page/html/footer.phtml">
<block type="page/html_wrapper" name="bottom.container" as="bottomContainer" translate="label">
<label>Page Footer</label>
<action method="setElementClass"><value>bottom-container</value></action>
</block>
<block type="page/switch" name="store_switcher" as="store_switcher" after="*" template="page/switch/stores.phtml"/>
<block type="page/template_links" name="footer_links" as="footer_links" template="page/template/links.phtml">
<action method="setTitle"><title>Quick Links</title></action>
</block>
/*---- here is my block---*/
<block type="cms/block" name="Footer Links">
<action method="footer_links3"><block_id>name-of-static-block</block_id></action>
</block>
/*---- here is my block---*/
<block type="page/template_links" name="footer_links2" as="footer_links2" template="page/template/links.phtml">
<action method="setTitle"><title>Account</title></action>
</block>
<block type="page/template_links" name="footer_links3" as="footer_links3" template="page/template/links.phtml">
<action method="setTitle"><title>ss</title></action>
</block>
<!-- This static block can be created and populated in admin. The footer_links cms block can be used as a starting point. -->
<block type="cms/block" name="footer_social_links">
<action method="setBlockId"><block_id>footer_social_links</block_id></action>
</block>
</block>
我在 page.xml
中添加了此代码从 CMS-static block 部分,我们创建了包含以下属性的下一个块:
阻止标题=页脚链接
Identifier = footer_links3
商店视图=所有商店视图
你能否告诉我有什么问题?为什么网站上没有任何内容?
修改
footer.phtml代码
<div class="footer-container">
<div class="footer">
<?php echo $this->getChildHtml('my_footer_links') ?>
<?php echo $this->getChildHtml() ?>
<address class="copyright"><?php echo $this->getCopyright() ?></address>
</div>
</div>
xml代码:
<block type="cms/block" name="my_footer_links">
<action method="setBlockId"><block_id>footer_links3</block_id></action>
</block>
答案 0 :(得分:0)
请替换:
<block type="cms/block" name="Footer Links">
<action method="footer_links3"><block_id>name-of-static-block</block_id></action>
</block>
使用:
<block type="cms/block" name="my_footer_links">
<action method="setBlockId"><block_id>footer_links3</block_id></action>
</block>
您在操作方法中使用了 footer_links3 ,这是错误的。
之后,您需要使用$ this-&gt; getChildHtml方法从footer.phtml文件中调用它。
<?php echo $this->getChildHtml('my_footer_links') ?>
检查后请告诉我结果。