drupal 8为登录页面设置了另一个主题

时间:2016-01-13 08:28:19

标签: drupal-modules drupal-theming drupal-8

我是 drupal 8 的新手,我开发了一个自定义主题,但我想将 bartik 主题用于核心模块用户,特别是登录(但我可以接受为所有模块设置)。如果不触及drupal核心,我怎么能这样做?

注意: Bartik是我网站的管理主题

提前致谢。

1 个答案:

答案 0 :(得分:0)

您想将您的管理主题用于login.logout页面吗?

使用主题否定者:https://drupal.stackexchange.com/questions/201530/how-can-i-change-the-active-theme-programmatically

以下是一个旧例子:https://www.drupal.org/node/2158619

对于记录,这是旧的Drupal 7方式:

/**
 * Force Admin theme for user login paths
 * @see hook_custom_theme()
 * 
 * @return string
 */
function ocb_home_custom_theme() {
  $admin_theme = variable_get('admin_theme', 0);
  if (arg(0) == 'user' && $admin_theme !==0 )  {
    return $admin_theme;
  }
}
相关问题