我正在尝试通过空白主题中的 customer.xml 文件(这是在 Magento 1.4.1.1 中)向顶级客户链接(我的帐户、我的购物车等)添加一些解释性文本
我认为magento通过发出afterText或beforeText参数具有开箱即用的功能,但是当我使用它们时,它似乎只在链接之前推东西(而不是之后,这就是我之后的东西)。
以下是 customer.xml 的摘录,其中包含附加的 参数:
<default>
<!-- Mage_Customer -->
<reference name="top.links">
<action method="addLink" translate="label title" module="customer"><label>Your Account</label><url helper="customer/getAccountUrl"/><title>Your Account</title><prepare/><urlParams/><position>10</position><null /><aParams>rel="nofollow"</aParams><afterText>click to login</afterText></action>
</reference>
</default>
以前有人有过这样的运气吗? liParams 是否需要一些额外的参数?
提前致谢!
编辑:这是似乎对我有用的最终代码。请注意按照建议添加额外字段
谢谢你,它很有帮助。你和@Zyava 下面的回答都帮助我解决了这个问题。
您的上述建议中缺少一个字段(innerText 字段)。我已将完整的代码放在下面,看起来对我有用。希望它对其他人有帮助!
<action method="addLink" translate="label title" module="customer">
<label>Your Account</label>
<url helper="customer/getAccountUrl"/>
<title>Your Account</title>
<prepare/>
<urlParams/>
<liParams/>
<aParams>rel="nofollow"</aParams>
<innerText/>
<beforeText>yourbeforetext</beforeText>
<afterText>youraftertext</afterText></action>
非常感谢@clockworkgeek 和@zyava - 你们的回答都帮助我解决了这个问题。
不幸的是,XML 标记名称与变量参数无关,重要的是参数的数量。您需要指定最多的所有参数afterText
包括beforeText
.
<action method="addLink" translate="label title" module="customer">
<label>Your Account</label>
<url helper="customer/getAccountUrl"/>
<title>Your Account</title>
<prepare/>
<urlParams/>
<position>10</position>
<liParams/>
<aParams>rel="nofollow"</aParams>
<beforeText/>
<afterText>click to login</afterText>
</action>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)