Saturday, February 18, 2012

Magento : Add extra links to top links in header


We always need to add links apart from default top links in magento.
Here are the steps to add extra links to top links without touching the core files.

1)   Find   "<block type="page/template_links" name="top.links" as="topLinks"/>" in
page.xml    and paste just below this

<!--Added for showing extra links below top links start("/Clients/slendersbeauty/index.php" should be removed in below three links when go live)-->
                <block type="page/template_links" name="header_links" as="header_links" template="page/template/header_links.phtml">
                    <action method="addLink" translate="label title" ><label>AANBIEDINGEN</label><url>/aanbiedingen</url><title>AANBIEDINGEN</title><prepare/><urlParams/><position>10</position></action>
                    <action method="addLink" translate="label title" ><label>OVER ONS</label><url>/about-magento-demo-store</url><title>OVER ONS</title><prepare/><urlParams/><position>10</position></action>
                    <action method="addLink" translate="label title" ><label>CONTACT</label><url>/contacts</url><title>CONTACT</title><prepare/><urlParams/><position>10</position></action>
                </block>
            <!--Added for showing extra links below top links end-->


2)  Copy    /app/design/frontend/base/default/template/page/template/links.phtml
to  a file /app/design/frontend/base/default/template/page/template/header_links.phtml

3)  In /app/design/frontend/base/default/template/page/html/header.phtml
paste     <?php echo $this->getChildHtml('header_links') ?>
where you want to appear the above links.

and now you can see the extra links apart from top links in header .

7 comments:

  1. hi, i'm trying to set my blog up to look like a regular web page. i have multiple pages set up, but would like my posts to show only a link in my home page and appear when you click on them that your going to another page. i also wanted if you were to put the mouse over the page buttons you see a list drop down of posts with that label, then if you clicked on that page you would get a list of my written out posts with that label. i'm doing a fantasy football site and would like to make it look as professional as possible.

    thanks
    bill
    thefantasyprophet.net

    ReplyDelete
    Replies
    1. Hi,
      you didnot specify if your site is in magento or any other script that will help me to guige more accurately. It will be more better if you can provide link for your site.

      Delete
  2. sorry, i also wanted to see how i can only show my intro on just my home page. it is on every page now. i'd like to also see how i place gadgets on specific pages. i found nfl team gadgets and would like to only show them on a nfl team page.

    thanks again
    bill

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete
  4. Nice blog, i have magento 1.6, it work fine for me, i have put Contact Us link but it is show like "Log InContact Us" there is not gap between them and no line |.

    ReplyDelete
    Replies
    1. Can you please give us the site link so that we ca see the output and help accordingly.
      Thanks

      Delete