【问题标题】:Magento call account information phtml blockMagento调用账户信息phtml块
【发布时间】:2015-01-29 14:34:24
【问题描述】:

我们正在我们的网站上创建另一个页面,其中包含帐户信息布局。
我们想调用此块,但最终只有 h3 标题:帐户信息。
我们使用了这个:

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

结果:

我们想要什么:

别管类别!

是不是我们做错了什么,好吧,显然我们做错了什么。

需要更多信息吗?欢迎提问!

【问题讨论】:

  • 我也有同样的问题

标签: javascript magento account php


【解决方案1】:

首先,您必须在布局xml中设置此操作的页面模板。

如下:

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

然后你把你的块代码放到&lt;reference name="content"&gt; ..... &lt;/reference&gt;块中。

【讨论】:

  • 我需要把这段代码放在layout.xml代码还是后端? (布局更新 XML)
  • 我使用管理面板创建了该页面,不是为了我的健康,而是为了我的同事;)
  • 我会给出另一个答案。
  • 谢谢!我会很感激的!
  • 请在“设计”选项卡中选择“2 列左栏”布局。
【解决方案2】:

当您在页面内容中输出 {{block...}} 声明时,您要做的是使用 XML 布局将菜单插入到“左侧”块中,即左侧边栏

在“设计”>“页面布局”>“布局”中选择左侧边栏 2 列,然后将此块粘贴到 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>

这个答案是对 this 帖子的部分引用,我对 magento 的额外块进行了一些研究

此实现也有一些限制,因为您无法确保此页面的安全。据我所知,您需要为此创建一个自定义模块,@AlanStorm 的 article 应该可以帮助您

【讨论】:

  • 他想要页面内容中的数据,因为我们(我和他我们正在一起工作)希望在顶部有标签页,然后是帐户信息、目录和其他一些标签跨度>
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-02-28
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多