How to create new page in magento site

后端 未结 1 1432
时光说笑
时光说笑 2021-01-20 07:47

I am trying to create a new page in magento ,in which I have to add some html and javascript. For this ,I have created a module . Contents of -> app\\code\\local\\CompanyNam

相关标签:
1条回答
  • 2021-01-20 08:27

    Insert to module's config.xml:

    <frontend>
    ...
      <layout>
        <updates>
          <helloworld>
            <file>helloworld.xml</file>
          </helloworld>
        </updates>
      </layout>
    </frontend>
    

    Next add layout file app/design/frontend/default/default/layout/helloworld.xml:

    <?xml version="1.0" encoding="UTF-8"?>
    <layout version="0.1.0">
      <helloworld_index_index>
        <reference name="content">
          <block type="helloworld/index" name="helloworld_any_block" template="helloworld/index.phtml" />
        </reference>
      </helloworld_index_index>
    </layout>
    

    Eventually add phtml file app/design/frontend/default/default/template/helloworld/index.phtml with any content.

    0 讨论(0)
提交回复
热议问题