Magento – How to add external url link in Magento Admin menu

adminhtmlmagento-1.7magento-1.9

I am working on a module where i created some menu in Magento admin using adminhtml.xml

Now i want to link one of the menu to an external url and set target="blank". But i not sure how to do it in adminhtml.xml. Here is my code.

<?xml version="1.0"?>
<config>
    <menu>
        <system>
            <children>
                <convert translate="title">
                    <children>
                        <importmagmi translate="title" module="importexport">
                            <title>MagMi Importer</title>
                            <action><url helper="https://externalurl.com /></action>
                            <sort_order>100</sort_order>
                        </importmagmi>
                    </children>
                </convert>
            </children>
        </system>
    </menu>
</config>

When i am checking its adding current domain name before external url.
ex: http://mydomainname.com/https://externalurl.com

I am wondering how to set only external URL?

Best Answer

Inside <action> tag you can put module/controller/action of your module.

Then create this action and put something like this:

public function locationAction()
{
    $this->_redirectUrl('http://www.example.com/');
}

See Mage_Core_Controller_Varien_Action::_redirectUrl for the standard redirect implementation in Magento controller actions.