Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This project is not covered by Drupal’s security advisory policy.
The Theme Rules module provides an action to switch themes. It affects a user's account, as though they changed the setting in their own profile.
Drupal 7.x
Using Entity API, Rules can natively change a user's theme. For example:
{ "rules_set_user_theme" : {
"LABEL" : "Set user theme",
"PLUGIN" : "rule",
"REQUIRES" : [ "rules" ],
"USES VARIABLES" : {
"user" : { "label" : "User", "type" : "user" },
"theme" : { "label" : "Theme", "type" : "text" }
},
"DO" : [ { "data_set" : { "data" : [ "user:theme" ], "value" : [ "theme" ] } } ]
}
}
Background Discussions
Rules issue: #417664: Action: switch theme
ThemeKey issue: #647716: Integrate with Rules
Acknowledgements
Madhusudhan Srinivasa of QED42 is the co-creator of this module.
Project information
- Seeking co-maintainer(s)
Maintainers are looking for help reviewing issues. - Module categories: Automation, Developer Tools
- 2 sites report using this module
- Created by mitchell on , updated
- This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.