簡體   English   中英

Magento呼叫帳戶信息phtml塊

[英]Magento call account information phtml block

我們正在網站上制作另一個頁面,其中包含帳戶信息布局。
我們想調用此塊,但最終只得到h3標題:帳戶信息。
我們使用了這個:

{{block type="core/template" template="customer/account/dashboard.phtml"}}

結果:

http://i.imgur.com/Q17INWi.jpg

我們想要什么:

http://i.imgur.com/RBCWKQj.png

沒關系的類別!

我們有做錯什么嗎,好吧,顯然我們做錯了什么。

需要更多信息嗎? 隨便問!

首先,您必須在布局xml中為此操作設置頁面模板。

如下所示:

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

然后將代碼塊放入<reference name="content"> ..... </reference>塊中。

當輸出{{block ...}}聲明時,是在頁面內容中進行的,您要做的是使用XML布局將菜單插入“ left”塊,也就是左側邊欄

在“設計”>“頁面布局”>“布局”中,選擇左側兩欄,然后將此塊粘貼到XML部分中(如果需要,請刪除不必要的鏈接):

<reference name="left">
    <block type="customer/account_navigation" name="customer_account_navigation" before="-" template="customer/account/navigation.phtml">
        <action method="addLink" translate="label" module="customer"><name>account</name><path>customer/account/</path><label>Account Dashboard</label></action>
        <action method="addLink" translate="label" module="customer"><name>account_edit</name><path>customer/account/edit/</path><label>Account Information</label></action>
        <action method="addLink" translate="label" module="customer"><name>address_book</name><path>customer/address/</path><label>Address Book</label></action>
        <action method="addLink" translate="label" module="downloadable"><name>downloadable_products</name><path>downloadable/customer/products</path><label>My Downloadable Products</label></action>
        <action method="addLink" translate="label" module="newsletter"><name>newsletter</name><path>newsletter/manage/</path><label>Newsletter Subscriptions</label></action>
        <action method="addLink" translate="label" module="oauth"> <name>OAuth Customer Tokens</name> <path>oauth/customer_token</path> <label>My Applications</label> </action>
        <action method="addLink" translate="label" module="review"><name>reviews</name><path>review/customer</path><label>My Product Reviews</label></action>
        <action method="addLink" translate="label" module="sales"><name>orders</name><path>sales/order/history/</path><label>My Orders</label></action>
        <action method="addLink" translate="label" module="tag"><name>tags</name><path>tag/customer/</path><label>My Tags</label></action>
        <action method="addLink" translate="label" module="wishlist" ifconfig="wishlist/general/active"><name>wishlist</name><path>wishlist/</path><label>My Wishlist</label></action>
    </block>
</reference>

這個答案是對這篇文章的部分參考,我對magento的其他代碼塊做了一些研究

由於無法確保此頁面的安全性,因此此實現也有局限性。 據我所知,您需要為此創建一個自定義模塊,@ AlanStorm的這篇文章應該可以為您提供幫助

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM