مجنتو: تغییر در لینک های بالای سایت (topLinks)

برای تغییر در لینک های topLinks فایل app/design/frontend/{default}/{theme}/layout/customer.xml را تغییر دهید:

<customer_logged_in>
        <reference name="top.links">
          <action method="addLink" translate="label title" module="customer"><label>My Account</label><url helper="customer/getAccountUrl"/><title>My Account</title><prepare/><urlParams/><position>10</position></action>
          <action method="addLink" translate="label title" module="customer"><label>Log Out</label><url helper="customer/getLogoutUrl"/><title>Log Out</title><prepare/><urlParams/><position>11</position></action>
        </reference>
    </customer_logged_in>

<!--
Load this update on every page when customer is logged out
-->

    <customer_logged_out>
        <!--<reference name="right">
            <block type="customer/form_login" name="customer_form_mini_login" before="-" template="customer/form/mini.login.phtml"/>
        </reference>-->
        <reference name="top.links">
            <action method="addLink" translate="label title" module="customer"><label>Register</label><url helper="customer/getRegisterUrl"/><title>Register</title><prepare/><urlParams/><position>10</position></action>
            <action method="addLink" translate="label title" module="customer"><label>Log In</label><url helper="customer/getLoginUrl"/><title>Log In</title><prepare/><urlParams/><position>11</position></action>
        </reference>
        <remove name="reorder"></remove>
    </customer_logged_out>

اضافه کردن class به لینک ها

<action method="addLink">
    <label/>
    <url/>
    <title/>
    <prepare/>
    <urlParams/>
    <position/>
    <liParams>
        <class>myclassname</class>
    </liParams>
    <aParams>
        <class>myclassname</class>
    </aParams>
    <beforeText/>
    <afterText/>
</action>

برای اضافه کردن کلاس به لینک wishlist

I followed some suggestions from this Magento Forum post, but none of them did the trick for me, but the last one was close. Here's what I did:

  1. Copy /app/code/core/Mage/Wishlist/Block/Links.php to /app/code/local/Mage/Wishlist/Block/Links.php
  2. Inside the _toHtml() method, add $this->a_params = 'class="your-class"'; just before the return parent::_toHtml(); statement
برچسب ها: 

افزودن نظر جدید