Search code examples
drupaldrupal-7

Drupal ThemeKey: how to set a theme based on path


I am using Drupal 7. I read this post:

How Load a Theme For Path

so I did tests but it did not work.

Basically, I created a role called editor. My website has its own theme (it is a sub-theme of Bootstrap theme https://www.drupal.org/project/bootstrap).

When I sign in as editor and go to page /admin/content to see a list of nodes, the page uses the Bootstrap sub-theme. I want to use Seven for /admin/content.

In ThemeKey, I have this rule only:

Property: drupal:path
Operator: =
Value: admin/content
Theme: Seven

However, I am unable to see any change. I cleared the cache, etc. No success. This seems to be a very easy task for use/config. Don't know where I got it wrong.

Thanks for help!


Solution

  • Eventually, I used the module called Theme by Role https://www.drupal.org/project/tbr. To make it work, select "view the administration theme" permission for your role in /admin/people/permissions, which is the tip I got from many hours of tests and reading of the module's source code.

    Hope this helps someone else.