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

Link Code Bug? 
 
aquiss
Member
 
Total Posts:  54
Joined:  2008-05-03
United Kingdom
 

I’m in the process of breaking apart a few of the page elements up so that I can use them in a more freely in our site template, and I appear to have come across what appears to be a bug (i think).

The problem relates to the top links (My Account, My Wishlist etc) and links generated in the footer (Site Map, Search Terms etc) and that they appear to be both using the same bit of code to generate the links, which is think is incorrect.

The code they both appear to be using is:

/app/design/frontend/default/default/template/page/template/links.phtml

but I would have thought that links at the top should be using (though a changes in this file appears not to do anything):

/app/design/frontend/default/default/template/page/html/top.links.phtml

Is this a known issue or am I going mad?

 
Magento Community Magento Community
Magento Community
Magento Community
 
laurent
Member
 
Total Posts:  75
Joined:  2007-08-31
Paris, France
 

There is no bug or issue, this is just a way of using templates. In the default theme, both header links and footer links are using the same template file. Why not? In your template, you can easily use different templates as this is done in the modern theme.
Just copy links.phtml and name it footer_links.phtml and declare your new template in page.xml.
find

<block type="page/template_links" name="footer_links" as="footer_links" template="page/template/links.phtml"/>
replace with
<block type="page/template_links" name="footer_links" as="footer_links" template="page/template/footer_links.phtml"/>
 
Magento Community Magento Community
Magento Community
Magento Community
 
Black Cat
Mentor
 
Avatar
Total Posts:  3481
Joined:  2008-02-14
Assemini / Cagliari (Italy)
 

he, has tried that solution but it has not served. It keeps on using the template of the file links.phtml
I have checked different times that the name was correctly written. I don’t know what other to do…

 
Magento Community Magento Community
Magento Community
Magento Community
 
Trey Piepmeier
Jr. Member
 
Avatar
Total Posts:  1
Joined:  2008-05-20
 

How do you manage the links that are in the

links.phtml
template?  Where does the data from
$this->getLinks();
come from?
 
Magento Community Magento Community
Magento Community
Magento Community
 
corbykissler
Member
 
Total Posts:  39
Joined:  2008-05-14
 

I would like to know where the data comes from for the links as well. . .

Or be referred to some documentation that explains the modules.

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
sherrie
Moderator
 
Avatar
Total Posts:  1655
Joined:  2007-12-14
Waterloo, ON
 

Me too - where are the links hiding?

 
Magento Community Magento Community
Magento Community
Magento Community
 
corbykissler
Member
 
Total Posts:  39
Joined:  2008-05-14
 

So I found this code . . .

<default>

<!-- Mage_Customer -->
<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>
</reference>



</default>

It appears to add a link to the links module - this particular one is in the customers.xml layout -

So _it looks like_ adding links is done through the different layouts - you can add them based on where the customer is in the process (are they logged in and out, etc)

That’s all the information I have right now - I’m still trying to figure out why some of mine aren’t showing up. .. .

Hope that helps!

 
Magento Community Magento Community
Magento Community
Magento Community
 
sherrie
Moderator
 
Avatar
Total Posts:  1655
Joined:  2007-12-14
Waterloo, ON
 

This is how I solved it:

http://www.magentocommerce.com/boards/viewthread/2756/#t11382

 
Magento Community Magento Community
Magento Community
Magento Community
 
sdb
Sr. Member
 
Avatar
Total Posts:  223
Joined:  2007-11-13
coastal California, USA
 

good sleuthing, I have been wondering about this one too.

 
Magento Community Magento Community
Magento Community
Magento Community
 
sherrie
Moderator
 
Avatar
Total Posts:  1655
Joined:  2007-12-14
Waterloo, ON
 

I was able to remove links by changing their reference (the above link), so hopefully I won’t have a problem creating the new reference where I want the ones I took out of the top.  I haven’t gotten that far yet, though.

 
Magento Community Magento Community
Magento Community
Magento Community
 
sherrie
Moderator
 
Avatar
Total Posts:  1655
Joined:  2007-12-14
Waterloo, ON
 

Also, the way I found them all was by doing a search for:

method="addLink"

All the files are located in app/design/frontend/default/TEMPLATENAME/layout/

 
Magento Community Magento Community
Magento Community
Magento Community
 
corbykissler
Member
 
Total Posts:  39
Joined:  2008-05-14
 

Thanks for the followup - I have understood the links (I think) - I ran into a problem where I was using my own header (pageheader) structural block and couldn’t get the links box to show up in there - finally got that working.

now I am running into the situation where the actual add links need to be moved to the cms.xml page before they’ll show up - for instance, the customer.xml “my account” link is not showing up on my pages - thought that was weird - but I was getting the same behaviour from the checkout links as well.

Can anyone comment on the best practice of putting reference block references into the cms.xml file instead of elsewhere?  For instance - I put a bunch of static block in there that will be there for most pages.

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