我試圖通過空白主題中的customer.xml文件(這是在Magento 1.4中)向頂部客戶鏈接(我的帳戶,我的購物車等)添加一些解釋性文本.1.1)magento的customer.xml佈局文件中的其他參數
我認爲magento通過發佈afterText或beforeText參數具有開箱即用的功能,但是當我使用它們時,它似乎只是在鏈接之前推動了某些事情(而不是之後,這是我之後)。
這裏是從customer.xml包括額外< afterText>參數的摘錄:
<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--你們的答案都幫助我解決了這個問題。
謝謝clockworkgeek - 這個工作,它只需要添加 –
Andrew
是否有這樣的原因?這看起來像是頭腦遲鈍。 –
我想是因爲在它下面使用['call_user_func_array'](http://uk3.php.net/manual/en/function.call-user-func-array.php),它也與變量名稱不匹配,它只是關心條目的順序。否則就意味着需要額外的努力來做反射,當你只給出正確的參數數量時這是不必要的。 – clockworkgeek