Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Where Does Magento Get The Top Links From? 
 
Baseballtips
Sr. Member
 
Total Posts:  83
Joined:  2008-08-01
 

I’ve been looking for where Magento pulls the information to create the top links. The template file “links.phtml” uses the function getLinks(). That function in the file “links.php” simply returns the array “$_links”.

In what file is the $_links array filled with the default links?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Amin Amini
Member
 
Total Posts:  67
Joined:  2008-04-17
Sweden, Stockholm
 
Baseballtips - 17 February 2009 05:28 AM

I’ve been looking for where Magento pulls the information to create the top links. The template file “links.phtml” uses the function getLinks(). That function in the file “links.php” simply returns the array “$_links”.

In what file is the $_links array filled with the default links?

Hi Baseballtips,

Top links are specified in several layout files, i.e. the files in the app\design\frontend\default\default\layout directory, and added to the block called top.links, which is defined in the file fileapp\design\frontend\default\default\layout\page.xml. To actually find out in which files where links are assigned to top.links, you’ll have to search all of the files in the directory fileapp\design\frontend\default\default\layout\ for top.links. Check, for instance, wishlist.xml and the <default> layout handle and you should see something like this:

<default>

        <
reference name="top.links">
            <
block type="wishlist/links" name="wishlist_link">
                <
action method="addWishlistLink"></action>
            </
block>
        </
reference>

    </default>
The code above could be read as: to the block called top.links, add data from the method addWishlistLink, which is located at wishlist/links.

Regards,
Amin Amini

 
Magento Community Magento Community
Magento Community
Magento Community
 
Baseballtips
Sr. Member
 
Total Posts:  83
Joined:  2008-08-01
 

Thank Amin for such a quick response. I was checking back to say I realized they were all in corresponding xml files when I saw your response.

Thanks again dude.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top