更改Magento中联系表单的列布局

pix*_*ode 12 magento

在哪里可以更改Magento中默认联系页面的列布局(左侧2列,右侧2列等)?

谢谢

Ala*_*orm 17

首先,确定联系页面的"布局句柄".如果是您正在谈论的页面,那么您的布局句柄就是

contacts_index_index
Run Code Online (Sandbox Code Playgroud)

接下来,在layout.xml文件中找到布局句柄

<contacts_index_index translate="label">
    <label>Contact Us Form</label>
    <reference name="root">
        <action method="setTemplate"><template>page/2columns-right.phtml</template></action>
        <action method="setHeaderTitle" translate="title" module="contacts"><title>Contact Us</title></action>
    </reference>
    <reference name="content">
        <block type="core/template" name="contactForm" template="contacts/form.phtml"/>
    </reference>
</contacts_index_index>
Run Code Online (Sandbox Code Playgroud)

更改setTemplate调用以引用模板

<reference name="root">
    <action method="setTemplate"><template>page/1column.phtml</template></action>
    <action method="setHeaderTitle" translate="title" module="contacts"><title>Contact Us</title></action>
</reference>
Run Code Online (Sandbox Code Playgroud)

或者,将句柄引用添加到local.xml文件中.该local.xml文件最后应用,所以无论什么进入"胜利"

<layout>
    <contacts_index_index>
        <reference name="root">
            <action method="setTemplate"><template>page/2columns-left.phtml</template></action>    
        </reference>
    </contacts_index_index>
</layout>   
Run Code Online (Sandbox Code Playgroud)


Ali*_*son 6

联系页面的布局在contacts.xml中设置.因此,另一种方法是:

1.在基本布局文件夹中查找contacts.xml
2.复制该文件中的内容
3.在模板的布局文件夹中创建新的contacts.xml文件
4.粘贴该文件的内容并找到设置默认布局的行

<reference name="root">
   <action method="setTemplate"><template>page/2columns-left.phtml</template></action>
   <action method="setHeaderTitle" translate="title" module="contacts"><title>Contact Us</title></action>
</reference>
Run Code Online (Sandbox Code Playgroud)

5.将该行更改为您希望的默认布局

<reference name="root">
   <action method="setTemplate"><template>page/1column.phtml</template></action>
   <action method="setHeaderTitle" translate="title" module="contacts"><title>Contact Us</title></action>
</reference>
Run Code Online (Sandbox Code Playgroud)

6.保存,它将覆盖默认布局