0

我想知道是否有办法在 Joomla 管理员中更改起始页。我想在用户登录而不是控制面板时显示组件权限。

编辑:我想我真正想要的是在我登录时重定向说 index.php&option=com_mycomponent ,但我仍然希望能够访问控制面板等。

谢谢你。

4

4 回答 4

1

对于 Joomla 3.X,您需要通过添加文件(和文件夹树)来覆盖管理模板中的 cpanel 组件: [tpl_xxx]/html/com_cpanel/cpanel/default.php

其中 tpl_xxx 是您默认显示的管理模板。

然后你可以显示任何你喜欢的与你的组件相关的东西。

<?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' );
...
于 2014-10-21T17:40:50.600 回答
1

在您正在使用的管理员模板中找到 index.php。在其中,找到包含以下内容的行:

$cpanel   = ($option === 'com_cpanel');

之后只需添加:

if($cpanel){
    $app->redirect("index.php?option=com_xxx"); 
}

重定向到您喜欢的任何组件视图。第一行代码存在于 isis 模板中,第 99 行。如果不存在,则将 if 条件调整为

if($option === 'com_cpanel')
于 2015-07-12T18:15:36.583 回答
0

编辑 administrator/template_name/index.php 中的管理员模板 index.php 文件。注意:为避免任何更新问题,如果您正在寻找深度定制,最好克隆模板。另请注意,您可以在 www.yoursite.com/administrator/index.php?option=com_modules&filter_client_id=1 中向管理员模板添加/删除/更新/发布/取消发布模块

于 2013-09-12T18:04:52.080 回答
0

老问题,但我有同样的要求。我使用 Apache 的 mod_rewrite 修复了它,利用登录后没有查询字符串的事实。

编辑“path/to/administrator/.htaccess”并添加:

RewriteEngine on
RewriteCond %{QUERY_STRING} ^$
RewriteRule index.php index.php?option=<your_start_component>
于 2015-05-09T19:05:04.953 回答