Skip to main content
edited title
Link
Alex
  • 811
  • 4
  • 10
  • 31

magento 1.9 open adminhtml menu external link in new browser tab

Source Link
Alex
  • 811
  • 4
  • 10
  • 31

magento 1.9 open adminhtml menu link in new browser tab

I need to add a link in the admin menu to an external web that opens in a new browser tab.

So I developed a module, and this is its config.xml

<frontend>
    <routers>
      <crmlink>
        <use>standard</use>
        <args>
          <module>MySpace_Crmlink</module>
          <frontName>crmlink</frontName>
        </args>
      </crmlink>
    </routers>
</frontend>
<adminhtml>
    <menu>
        <customer translate="title" module="customer">
            <title>Customers</title>
            <sort_order>40</sort_order>
            <!-- action>adminhtml/customer/</action -->
            <children>
                <crmlink translate="title" module="crmlink">
                    <title>CRM link</title>
                    <action>crmlink</action>
                    <sort_order>1010</sort_order>
                </crmlink>
            </children>
         </customer>
    </menu>
</adminhtml>

And then, there is a controller:

<?php
class MySpace_Crmlink_IndexController extends Mage_Core_Controller_Front_Action
{
    public function indexAction()
    {
        $this->_redirectUrl('www.example.com');
    }
}

It is working fine, the link is displayed under customer menu, and it works, I'm redirected to the external page example.com, but I need to open it in a ned browser tab, and I can't do it from the controller.

Is there a way to open the external link in a new tab as a target="_blank"? I don't see a way to do it from the xml.