【问题标题】:add icon instead of label in link在链接中添加图标而不是标签
【发布时间】:2014-01-06 08:51:41
【问题描述】:

我写了这段代码:

<action method="addLink" translate="label title" module="checkout">
    <label>Cart</label>
    <url helper="checkout/url/getCartUrl"/>
    <title>Cart</title>
    <prepare/>
    <urlParams/>
    <position>150</position>
</action>

但不是label 购物车 我想展示一张图片。如何在上面的 xml 代码中添加图片?

【问题讨论】:

    标签: magento-1.8 magento-layout-xml


    【解决方案1】:
    <action method="addLink" translate="label title" module="checkout">
        <label>Cart</label>
        <url helper="checkout/url/getCartUrl"/>
        <title>Cart</title>
        <prepare/>
        <urlParams/>
        <position>150</position>
        <liParams />
        <aParams><![CDATA[ class="cart"]]></aParams>
    </action>
    

    这应该向&lt;a&gt; 元素添加一个类cart。您可以在隐藏文本并显示图标的类上添加您的 CSS。

    【讨论】:

      猜你喜欢
      • 2018-01-07
      • 1970-01-01
      • 2016-09-16
      • 2017-06-16
      • 2012-03-13
      • 1970-01-01
      • 1970-01-01
      • 2021-01-12
      • 1970-01-01
      相关资源
      最近更新 更多