2010-07-23 22 views

Trả lời

17

Trước tiên, hãy xác định "xử lý bố cục" cho trang liên hệ. Nếu this là trang web mà bạn đang nói đến, rồi xử lý bố cục của bạn là

contacts_index_index 

Tiếp theo, tìm ra xử lý bố trí trong tập tin Layout.xml bạn

<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> 

Thay đổi cuộc gọi setTemplate để tham khảo mẫu của bạn

<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> 

Cách khác, thêm tham chiếu tay cầm vào tệp local.xml của bạn. Các tập tin local.xml được áp dụng cuối cùng, vì vậy bất cứ điều gì đi vào đó "thắng"

<layout> 
    <contacts_index_index> 
     <reference name="root"> 
      <action method="setTemplate"><template>page/2columns-left.phtml</template></action>  
     </reference> 
    </contacts_index_index> 
</layout> 
6

Bố cục của trang liên hệ được đặt trong contacts.xml. Vì vậy, một phương pháp thay thế là:

1. Tìm contacts.xml trong thư mục bố cục cơ sở
2. Sao chép nội dung trong tệp đó
3. Tạo tệp contacts.xml mới trong thư mục bố cục của mẫu của bạn
4. Dán nội dung của tập tin đó và tìm thấy những dòng mà đặt bố cục mặc định

<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> 

5. Thay đổi mà xếp hàng để bất cứ điều gì bạn muốn bố trí mặc định của bạn là

<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> 

6. Lưu, và nó quan trọng hơn cách bố trí mặc định

1

Thứ nhất, Tìm contacts.xml trong thư mục bố trí cơ sở, sau đó trong 41 dòng,

thay đổi mã này từ

<action method="setTemplate"><template>page/2columns-right.phtml</template></action> 

để

<action method="setTemplate"><template>page/2columns-left.phtml</template></action> 
Các vấn đề liên quan