Knowledgebase

How to allow users to choose their default theme in Drupal

In Drupal you can install and enable as many themes as you want, and one of them is the default theme for the whole site. The Drupal core doesn't have a function that let's each user to modify their account in terms of choosing their own default theme that will be displayed once they log in. However, for this purpose you can use a handy contributed module called Switch Theme.

Download the module, and then install and enable it. There's nothing particularly different in the way this module is installed; it's done in the same way as most other modules are installed. There are no additional things that you have to do. For more information check out the article on installing modules.

After the module is enabled you need to edit its permissions. In the admin panel of your Drupal go to People>Permissions and scroll down to the section labeled Switchtheme. There's a permission labeled Switch themes which is exactly for allowing people to select their default theme. Mark the checkbox for that permission corresponding to the user role that you want to be able to do that, and then just click on the Save permissions button at the bottom. Now users that belong to the user role for which you enabled that function will be able to select a theme from the ones that you have enabled from the admin panel.

You also have to make the option visible on the frontend for all the themes that you have enabled. In your Drupal admin panel go to Structure tab>Blocks. On the page that opens you should be able to find a Switch theme block in the Disabled blocks section. Click on its Configure button and on the page that opens you can select where the block should appear for each of the enabled themes.

Was this answer helpful?

 Print this Article

Also Read