Templates 如何为用户/访问设置Joomla模板
我想使用特定的Joomla模板(没有导航,没有顶部和底部)为通过我的移动应用程序连接到网站的用户提供iframe。我假设该用户将从特定地址开始使用tmplparam(或类似的东西)连接,但是有没有办法为这些用户锁定该模板Templates 如何为用户/访问设置Joomla模板,templates,session,joomla,Templates,Session,Joomla,我想使用特定的Joomla模板(没有导航,没有顶部和底部)为通过我的移动应用程序连接到网站的用户提供iframe。我假设该用户将从特定地址开始使用tmplparam(或类似的东西)连接,但是有没有办法为这些用户锁定该模板 也许有一些插件可以在会话数据中设置模板并覆盖默认模板选择?有一个名为template Assigner-的Joomla扩展。它完全满足您的需要。有一个名为Template Assigner-的Joomla扩展。它完全符合您的要求。插件允许我仅为specyfic用户组设置模板,而
也许有一些插件可以在会话数据中设置模板并覆盖默认模板选择?有一个名为template Assigner-的Joomla扩展。它完全满足您的需要。有一个名为Template Assigner-的Joomla扩展。它完全符合您的要求。插件允许我仅为specyfic用户组设置模板,而不是相应地将模板切换到url,但由于您的想法,我创建了非常简单的插件来实现此目的,代码如下:
defined('_JEXEC') or die;
class plgSystemMobiler extends JPlugin
{
public function onAfterInitialise()
{
$app = JFactory::getApplication();
$jinput = $app->input;
if (isset($_REQUEST['mobile'])) $par=(int)$_REQUEST['mobile'];
if (isset($par)) $jinput->cookie->set('mobile', $par, time() + 100000, $app->get('cookie_path', '/'), $app->get('cookie_domain'), $app->isSSLConnection());
$cookie=$jinput->cookie->get('mobile');
if (intval($cookie)>0) JFactory::getApplication()->input->set('templateStyle', intval($cookie));
}
}
Plugin允许我仅为specyfic用户组设置模板,而不是将模板相应地切换到url,但由于您的想法,我创建了非常简单的插件来实现这一点,代码如下:
defined('_JEXEC') or die;
class plgSystemMobiler extends JPlugin
{
public function onAfterInitialise()
{
$app = JFactory::getApplication();
$jinput = $app->input;
if (isset($_REQUEST['mobile'])) $par=(int)$_REQUEST['mobile'];
if (isset($par)) $jinput->cookie->set('mobile', $par, time() + 100000, $app->get('cookie_path', '/'), $app->get('cookie_domain'), $app->isSSLConnection());
$cookie=$jinput->cookie->get('mobile');
if (intval($cookie)>0) JFactory::getApplication()->input->set('templateStyle', intval($cookie));
}
}