What I want:
Admin should redirect my custom module url('adminhtml_module1/testimonial/index
') instead of dashboard page after successfully admin login.
Any idea ? How can I do this ?
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityWhat I want:
Admin should redirect my custom module url('adminhtml_module1/testimonial/index
') instead of dashboard page after successfully admin login.
Any idea ? How can I do this ?
Short answer:
The redirect is done to the page selected in
System > Configuration > Admin > Startup Page
.
If you already defined a menu node for your admin page, you should be able to select it form the dropdown.
Further information:
The dropdown consists of system config values form the source model adminhtml/system_config_source_admin_page
built in
app/code/core/Mage/Adminhtml/Model/System/Config/Source/Admin/Page.php
This iterates through all <menu>
nodes from the admin config entries.
The corresponding XML config node is admin/startup/page
where the corresponding URL for the redirect is retreived in Mage_Admin_Model_User
.
The actual redirect happens in Mage_Adminhtml_IndexController
:
/**
* Admin area entry point
* Always redirects to the startup page url
*/
public function indexAction()
{
$session = Mage::getSingleton('admin/session');
$url = $session->getUser()->getStartupPageUrl();
if ($session->isFirstPageAfterLogin()) {
// retain the "first page after login" value in session (before redirect)
$session->setIsFirstPageAfterLogin(true);
}
$this->_redirect($url);
}