A page has been created with panels which list all the contents of each user. I want to allow each user to be able to change the theme used for his own panel page. Whenever anyone visits the user panel page, they should see the theme of that user.

I have tried themekey but it only allows for sitewide theme.

What else can i do?

  • i think you have to create a custom module , and custom theme , so one theme and several set of colours , and then in you module save by user his choice . Finally use hook_init to modify css loaded by user preference
    – Fky
    Aug 7, 2017 at 11:49

1 Answer 1


You hook_custom_theme()

function MYMODULE_custom_theme() {
  // Set path specific theme.
  if (current_path() == 'Your Path') {
    return 'Your theme name here';

Note: Clear cache and have a check

Or You can use Drupal module: ThemeKey

ThemeKey allows you to define simple or sophisticated theme-switching rules which allow automatic selection of a theme depending on current path, taxonomy terms, language, node-type, and many, many other properties.

  • Thank you. But this will mean the admin is setting the theme. I want each user to be able to set their own theme for their own page Aug 8, 2017 at 14:12
  • I think you are looking for a module like drupal.org/project/switchtheme and also Themekey module has 'ThemeKey User Profile' configuration, enable the option for the user to select their own themes. Aug 9, 2017 at 3:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.