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

Calling out different topLinks in header for product pages
 
rickahontas
Member
 
Total Posts:  64
Joined:  2009-09-11
oakland, ca
 

I want to have a different top.links block appear on my product pages, as opposed to the rest of my site’s pages.

I looked at the page.xml and catalog.xml, trying – in vain – to remove the current top.links and replace it with a new top.links using a different template.

Here’s the code I was playing with in catalog.xml:

<reference name="header">
                <
remove name="top.links" />
            <
block type="page/template_links" name="top.links" as="topLinksProduct" template="page/template/links-product.phtml"/>
        </
reference>

That successfully removed the top.links block, but the new block doesn’t show. So, I tried:

<reference name="header">
                <!--<
remove name="top.links" />-->
                <
action method="unsetChild"><name>topLinks</name></action>
            <
block type="page/template_links" name="top.links" as="topLinksProduct" template="page/template/links-product.phtml"/>
        </
reference>

No luck either.

After some directory wide searches, I found the Links.php in the core code that’s defining the block template (page/template/links.phtml).  Can I create a duplicate php file, with the same path, in local? But if so, where do I call the new php file?

Thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Brent W Peterson
Moderator
 
Avatar
Total Posts:  3217
Joined:  2009-02-26
Minneapolis MN
 

Where are you defining this?

<action method="unsetChild"><name>topLinks</name></action>

I am assuming that is what you are trying to add.

 
Magento Community Magento Community
Magento Community
Magento Community
 
rickahontas
Member
 
Total Posts:  64
Joined:  2009-09-11
oakland, ca
 

Thanks, Brent. Unsetting the topLinks is a start, but I’m still confused as to where I’d call a different topLinks template for only Product store pages.

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