2015-01-01 96 views
1

我試圖將Magento中我的帳戶頁面的2列布局轉換爲1列布局。我不需要左欄的導航鏈接。我使用的是Magento 1.9.0.1,編程經驗非常有限。客戶帳戶儀表板的Magento SIngle列布局

主題開發人員告訴我需要自定義我的local.xml文件。

我還發現這個網站的其他線程 - Magento set customer my account layout to one column這表明我應該尋找在<customer_account>手柄。

是否有人能夠告訴我需要對此文件進行哪些更改?以下是我認爲是local.xml文件的相關部分。

謝謝!

<customer_account> 
    <reference name="left"> 
     <action method="unsetChild"><name>catalog.compare.sidebar</name></action> 
     <action method="unsetChild"><name>cart_sidebar</name></action> 
     <action method="unsetChild"><name>reorder</name></action> 
    </reference> 
</customer_account> 

<customer_logged_in> 
    <reference name="top.links"> 
     <action method="removeLinkByUrl"><url helper="customer/getLogoutUrl"/></action> 
     <action method="addLink" translate="label title" module="customer"> 
      <label>Log Out</label> 
      <url helper="customer/getLogoutUrl"/> 
      <title>Log Out</title> 
      <prepare/> 
      <urlParams/> 
      <position>100</position> 
      <liParams/> 
      <aParams>class="top-link-logout"</aParams> 
     </action> 
    </reference> 
    <reference name="left"> 
     <block type="sales/reorder_sidebar" name="sale.reorder.sidebar" as="reorder" template="sales/reorder/sidebar.phtml"/> 
    </reference> 
</customer_logged_in> 

<customer_logged_out> 
    <reference name="top.links"> 
     <action method="removeLinkByUrl"><url helper="customer/getLoginUrl"/></action> 
     <action method="addLink" translate="label title" module="customer"> 
      <label>Log In</label> 
      <url helper="customer/getLoginUrl"/> 
      <title>Log In</title> 
      <prepare/> 
      <urlParams/> 
      <position>100</position> 
      <liParams/> 
      <aParams>class="top-link-login"</aParams> 
     </action> 
    </reference> 
</customer_logged_out> 

<customer_account_edit translate="label"> 
    <reference name="left"> 
     <action method="unsetChild"><name>cart_sidebar</name></action> 
    </reference> 
</customer_account_edit> 

回答

1

更新您的local.xml文件,如下所示。

<customer_account_index translate="label"> 
    <label>Customer My Account Dashboard</label> 
    <update handle="customer_account"/> 
    <!-- Mage_Customer --> 
    <reference name="root"> 
     <action method="setTemplate"> 
      <template>page/1column.phtml</template> 
     </action> 
    </reference> 

    <reference name="my.account.wrapper"> 
     <block type="customer/account_dashboard" name="customer_account_dashboard" template="customer/account/dashboard.phtml"> 
     <block type="customer/account_dashboard_hello" name="customer_account_dashboard_hello" as="hello" template="customer/account/dashboard/hello.phtml"/> 
     <block type="core/template" name="customer_account_dashboard_top" as="top" /> 
     <block type="customer/account_dashboard_info" name="customer_account_dashboard_info" as="info" template="customer/account/dashboard/info.phtml"/> 
     <block type="customer/account_dashboard_newsletter" name="customer_account_dashboard_newsletter" as="newsletter" template="customer/account/dashboard/newsletter.phtml"/> 
     <block type="customer/account_dashboard_address" name="customer_account_dashboard_address" as="address" template="customer/account/dashboard/address.phtml"/></block> 
    </reference> 
</customer_account_index> 

變化是

<action method="setTemplate"><template>page/1column.phtml</template></action> 
+0

謝謝你,但不幸的是我local.xml文件,沒有上面的代碼。我也沒有'customer_account_index'句柄。我應該將操作方法​​添加到我的第一篇文章中列出的任何代碼中,還是我在錯誤的地方查找? – thuss

+0

是的。如果它不可用,您應該在xml文件中添加此句柄。 –

+0

我剛剛將以上所有代碼都添加到了我的local.xml中。它已根據需要更改爲1列布局,但現在如何將儀表板內容在頁面上列出兩次。我也想將所有其他相關客戶頁面更改爲1列布局,這一切都可以從1手柄更改嗎? – thuss