1

I added page links to my top navigation bar by creating subcategories and creating url rewrites and it's working perfectly. My question is: How do I make the link open in a new tab or new window? I have one item in the navigation that is linked to an external site and would like it to open in a new tab rather than take the user away from my site. Is this possible? My site's address is http://hi-schoolworld.com/ and the page is titled Life Pics

Thank you!!

3

This would be the proper way to open a Magento XML top link in a new tab:

<reference name="root">
    <reference name="top.links">
        <action method="addLink" translate="label title">
            <label>New Tab</label>
            <url>http://yoursite.com/newtab</url>
            <title>Retailer Login</title>
            <prepare/>
             <urlParams/>
            <position>2</position>
            **<aParams>class="new-tab" target="_blank"</aParams>**
        </action>
    </reference>
</reference>
1

This isn't a core Magento question, so it's probably going to get flagged.

Use the 'target' value in your link:

<a href="http://www.mycoolsite.com/" target="_blank">Visit my cool site </a>

_blank will cause the link to be opened in a new window or tab, depending on the users browser preferences.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.