Call-back icon  Sales: Call 800.374.8146 (N America)|757.278.0920 (International)

Magento

Open Source eCommerce Evolved

Magento Forum

   
Link Code Bug? 
 
aquiss
Member
 
Total Posts:  31
Joined:  2008-05-04
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:  47
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
Guru
 
Avatar
Total Posts:  686
Joined:  2008-02-14
Gonnesa (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…

 Signature 

Cerchi un Webdesigner o grafico per Magento? Contattami

Maintainer Traduzione Italiana
Moderatore Forum Italiano Magento
Magento Webdesigner

-------------My Blog--------------

 
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
Jr. Member
 
Total Posts:  26
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
Enthusiast
 
Avatar
Total Posts:  782
Joined:  2007-12-14
Illinois, USA
 

Me too - where are the links hiding?

 Signature 

Creativity is falling in love with the world. – Dewitt Jones
Current Projects: Gladrag Industries & Aqua Gear Direct • Currently Running: PHP 5.2.5/MySQL 5.0.45/Magento 1.1.3 on HostGator

 
Magento Community Magento Community
Magento Community
Magento Community
 
corbykissler
Jr. Member
 
Total Posts:  26
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
Enthusiast
 
Avatar
Total Posts:  782
Joined:  2007-12-14
Illinois, USA
 

This is how I solved it:

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

 Signature 

Creativity is falling in love with the world. – Dewitt Jones
Current Projects: Gladrag Industries & Aqua Gear Direct • Currently Running: PHP 5.2.5/MySQL 5.0.45/Magento 1.1.3 on HostGator

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

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

 Signature 

my preferred host: http://www.schostpro.com

 
Magento Community Magento Community
Magento Community
Magento Community
 
sherrie
Enthusiast
 
Avatar
Total Posts:  782
Joined:  2007-12-14
Illinois, USA
 

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.

 Signature 

Creativity is falling in love with the world. – Dewitt Jones
Current Projects: Gladrag Industries & Aqua Gear Direct • Currently Running: PHP 5.2.5/MySQL 5.0.45/Magento 1.1.3 on HostGator

 
Magento Community Magento Community
Magento Community
Magento Community
 
sherrie
Enthusiast
 
Avatar
Total Posts:  782
Joined:  2007-12-14
Illinois, USA
 

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/

 Signature 

Creativity is falling in love with the world. – Dewitt Jones
Current Projects: Gladrag Industries & Aqua Gear Direct • Currently Running: PHP 5.2.5/MySQL 5.0.45/Magento 1.1.3 on HostGator

 
Magento Community Magento Community
Magento Community
Magento Community
 
corbykissler
Jr. Member
 
Total Posts:  26
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
 
Sales: Call 800.374.8146 (North America) 757.278.0920 (International)
© Copyright 2008 Varien. Magento is a trademark of Irubin Consulting Inc. DBA Varien
Privacy Policy|Terms of Service
Magento Community Count
33268 users|344 users currently online|73919 forum posts