2012-05-18 52 views

回答

4

另一种方式来增加“我的账户”链接 转到应用程序/设计/前端/预设(或你的主题包)/(主题文件夹)/page/html/header.phtml。 在此文件中,您可以添加自定义“li”标签,并可以在Controller将其移动到“我的帐户”页面时为“我的帐户”添加链接。

这里还有一个方法可以让你:)

开放主题/布局/ customer.xml文件,然后修改显示在所有页面的客户链接部分,包括一个链接家里也给其他客户的链接您认为必要的服务页面,例如'返回'(如果您收到很多这些查询...)。

<default> 

    <!-- Mage_Customer --> 
    <reference name="top.links"> 
     <action method="addLink" translate="label title" module="customer"><label>Home</label><url></url><title>Home</title><prepare>true</prepare><urlParams/><position>5</position></action> 
     <action method="addLink" translate="label title" module="customer"><label>My Account</label><url helper="customer/getAccountUrl"/><title>My Account</title><prepare/><urlParams/><position>94</position></action> 
     <action method="addLink" translate="label title" module="customer"><label>Deliveries</label><url>deliveries</url><title>Deliveries</title><prepare>true</prepare><urlParams/><position>95</position></action> 
     <action method="addLink" translate="label title" module="customer"><label>Returns</label><url>returns</url><title>Returns</title><prepare>true</prepare><urlParams/><position>96</position></action> 
     <action method="addLink" translate="label title" module="customer"><label>Contact Us</label><url>contacts</url><title>Contact Us</title><prepare>true</prepare><urlParams/><position>97</position></action> 
    </reference> 
</default> 

享受:)

+0

我已添加自定义链接 – Dolly

3

选项1:

布局文件是用来显示在top.links块链接。您可以在相关的xml文件中删除它们,并保持原样。在checkout.xml你有这样的:

<default> 
    <reference name="top.links"> 
     <block type="checkout/links" name="checkout_cart_link"> 
      <action method="addCartLink"></action> 
      <action method="addCheckoutLink"></action> 
    </block> 
    </reference> 
</default> 

如果删除该块,然后他们将不再显示在top.links块这两个环节。

选项2:

另一种方法是,如你所说,创建一个CMS块,并在你的头包括这个代替。要包含一个CMS块模板文件,如果你想使用的布局系统使用此布局中的文件,您可以使用

<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('toplinksblock')->toHtml() ?> 

或者:

<reference name="footer"> 
    <block type="cms/block" name="sample_links"> 
    <action method="setBlockId"><block_id>sample_links</block_id></action> 
    </block> 
</reference> 

那么这个模板文件:

<?php echo $this->getChildHtml('sample_links') ?> 

选项3:

或者只是编辑top.links.phtml

+0

感谢您的回复。我通过自定义链接完成了它。 – Dolly