1
votes

I'm new on drupal 8 and I've developped a custom theme, but I would like to use the bartik theme for the core module users, specially for log in (but i can accept to set it for all the module). How can I do that without touching the drupal core?

Note: Bartik is the administration theme of my site

Thanks in advance.

1

1 Answers

0
votes

You want to use your admin theme for the login.logout page ?

Use the theme negociator : https://drupal.stackexchange.com/questions/201530/how-can-i-change-the-active-theme-programmatically.

Here's an old example : https://www.drupal.org/node/2158619

For the record this is the old Drupal 7 way :

/**
 * 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;
  }
}