1

I want to add newsletter link to my top link block like first link. I think that it can works adding some string in layout.xml files. I've tried to add this code into customer.xml but the newsletter link doesn't appear.

<default>
    <reference name="top.links">
        <action method="addLink" translate="label title" module="customer"><label>Newsletter</label><url helper="newsletter"/><title>Newsletter</title><prepare/><urlParams/><position>10</position></action>
    </reference>
</default>

Anyone can help me to understand how works the toplinks adding? Thanks

2

One way which could be possible is to apply a custom template to top.links

Add this to local.xml

<default>
    <reference name="top.links">
        <action method="setTemplate">
            <template>page/template/newToplinks.phtml</template>
        </action>
    </reference>
<default>

You can now add your items to newToplinks.phtml

the above would help to maybe insert the whole newsletter block, or whatever you would require in to top.link area using a new template file.

OR

to add a new link;

Open app/design/frontend/default/TEMPLATE/layout/customer.xml

Add the following at the bottom before closing </layout> tag.

<default>
<reference name="top.links">
  <action method="addLink" translate="label title">
    <label>Newsletter</label>
    <url>newsletter</url>
    <title>Sign up to our newsletter</title>
    <prepare>true</prepare>
    <position>2</position>
  </action>
</reference>
</default>

This will create a link to www.URL.com/newseltter/

Hope this help.

  • I use to add my custom link successfully, now how could i also show number of items like wishlist and cart shows? – amit_game Oct 23 '15 at 9:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.