Reputation: 15
I wonder if there is a way to change the start page in Joomla administrator. I would like to show a componenent right when the user logs in instead of the control panel.
Edit: I guess really what i'm looking for is a redirect to say index.php&option=com_mycomponent right when i login, but i still want to be able to access the control panel etc.
Thank you.
Upvotes: 0
Views: 3550
Reputation: 65
Find index.php inside administrator template you are using. Inside of it, find a line containing:
$cpanel = ($option === 'com_cpanel');
After that just add:
if($cpanel){
$app->redirect("index.php?option=com_xxx");
}
to redirect to any component view you like. First line of code exists in isis template, on line 99. If not, just adapt if condition to
if($option === 'com_cpanel')
Upvotes: 1
Reputation: 16
Old question but I had the same requirement. I fixed it by using Apache's mod_rewrite, taking advantage of the fact that no query string is present after logging in.
Edit "path/to/administrator/.htaccess" and add:
RewriteEngine on
RewriteCond %{QUERY_STRING} ^$
RewriteRule index.php index.php?option=<your_start_component>
Upvotes: 0
Reputation: 555
For Joomla 3.X
You need to override the cpanel component in your admin template by adding the file (and folder tree):
[tpl_xxx]/html/com_cpanel/cpanel/default.php
where tpl_xxx is your admin template to display by default.
Then you can display anything you like related to your component.
<?php
defined('_JEXEC') or die;
if(!defined('DS')) define('DS', DIRECTORY_SEPARATOR);
//Load pane behavior
jimport('joomla.html.pane');
jimport('joomla.application.component.model');
define(MYPATH_ADMINISTRATOR,JPATH_SITE.DS.'administrator'.DS.'components'.DS.'com_xxx'.DS);
require_once (MYPATH_ADMINISTRATOR.'models'.DS.'xxx.php');
JFactory::getLanguage()->load('com_xxx', JPATH_ADMINISTRATOR);
//initialise variables
$document = JFactory::getDocument();
$user = JFactory::getUser();
//load model
$xxxModel = JModelLegacy::getInstance( 'xxx', 'xxxModel' );
$extraData = $xxxModel->getExtraData();
//build toolbar
JToolBarHelper::title( JText::_( 'COM_XXX_XXX' ), 'home' );
...
Upvotes: 1
Reputation: 1931
Edit the administrator template index.php file in administrator/template_name/index.php. Note: to avoid any update problems, you better clone the template if you're looking for a deep customization. Also note that you can add/delete/update/publish/unpublish modules to the administrator template in www.yoursite.com/administrator/index.php?option=com_modules&filter_client_id=1
Upvotes: 0