douxingti9307 2015-11-05 13:53
浏览 12

如何在页脚上添加新块?Magento

I have this page:

link

I want to put an h1 tag as in the picture below.

enter image description here

In file app/design/frontend/rwd/default/layout/page.xml

I added the following code 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/test2" name="test" as="test" template="page/test2/test.phtml"></block> //here is my modification

                <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>
                <block type="page/template_links" name="footer_links2" as="footer_links2" template="page/template/links.phtml">
                    <action method="setTitle"><title>Account</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>

Then we created an PHTML file I put in location

page/test2/test.phtml

CODE FOR PHTML FILE

<h1>test</h1>

I want to do something as simple as learning to use block sites.

Can you please tell me what is good and what should correct?

Thanks in advance!

  • 写回答

1条回答 默认 最新

  • donglun4682 2015-11-05 15:05
    关注

    First of all: create your own theme instead of modifying core files, see: http://devdocs.magento.com/guides/m1x/ce19-ee114/RWD_dev-guide.html. And the problem with your code is your block type, try the core/template block:

    <block type="core/template" name="test" as="test" template="page/test2/test.phtml"></block>
    

    And when you're done testing, use some realistic names.

    评论

报告相同问题?

悬赏问题

  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了
  • ¥50 切换TabTip键盘的输入法