Switch Page Theme module allows to use different theme than the site default theme on specific pages. Module provides functionality to add multiple rules for different themes on specific set of pages for specific roles. This module also support Multi domain & Multilingual sites.
Configuration page path: /admin/config/system/switch_page_theme.
Clear cache to apply the changes.
Features
- Multiple set of rules can be added.
- Theme can be set for single page or list of pages.
- Theme can be assigned to specific roles.
- Wildcard '*' character can be used in drupal paths.
- Supports Multi domain sites.
- Supports Multilingual sites.
Project link:
https://www.drupal.org/project/switch_page_theme
Project Git url:
git clone --branch 8.x-3.x https://git.drupal.org/project/switch_page_theme.git
Manual reviews of other projects
https://www.drupal.org/node/2838541#comment-12048484
https://www.drupal.org/node/2844475#comment-12049191
https://www.drupal.org/node/2857851#comment-12049928
Comments
Comment #2
deepali_agarwal CreditAttribution: deepali_agarwal commentedComment #3
deepali_agarwal CreditAttribution: deepali_agarwal commentedComment #4
deepali_agarwal CreditAttribution: deepali_agarwal commentedComment #5
PA robot CreditAttribution: PA robot commentedFixed the git clone URL in the issue summary for non-maintainer users.
We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)
Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #6
deepali_agarwal CreditAttribution: deepali_agarwal commentedComment #7
erik.erskine CreditAttribution: erik.erskine commentedManual review:
I get this error message when I first visit
/admin/config/system/switch_page_theme
after installing the module:Warning: Invalid argument supplied for foreach() in Drupal\Core\Render\Element\Checkboxes::valueCallback() (line 100 of core/lib/Drupal/Core/Render/Element/Checkboxes.php).
I think that is because
$config->get('roles')
returns NULL before it has been set the first time. If you test for NULL, and set#default_value
to be an empty array if so, you'll avoid this error.A couple of other points regarding coding standards:
In PageThemeNegotiator, refer to interfaces instead of classes where possible, as described in the type hinting section here: https://www.drupal.org/docs/develop/coding-standards/object-oriented-code#hinting. In the constructor, rather than this:
do this instead:
Also, the local variables declared within the
PageThemeNegotiator
class should be declared with type hints:Comment #8
cchanana CreditAttribution: cchanana commentedHello deepali_agarwal,
In info.yml file use package "User interface" instead of "Custom".
Comment #9
sushilpal CreditAttribution: sushilpal commentedHi deepali_agarwal,
Please see below couple points related to user experience which can be fixed .
1) when i go to config page first time and provide info and save. but in some case I do not remove config for pages and theme settings and also did not want to add for others so i am not be able to do because these fields are mandatory.
As i think these fields should not mandatory or you can put dependency validation like if page config has value then roles and themes must be mandatory.
2) You can make these 3 fields as a field set and gave add more options. in this case we can multiple theme for multiple page. this feature will make more powerful to this.
Thanks
S
Comment #10
PA robot CreditAttribution: PA robot commentedClosing due to lack of activity. If you are still working on this application, you should fix all known problems and then set the status to "Needs review". (See also the project application workflow).
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #11
deepali_agarwal CreditAttribution: deepali_agarwal commentedFixed all the issues mentioned above.
Add more option is a new functionality which is added in future enhancements. Will release that feature ASAP.
Thanks
Comment #12
deepali_agarwal CreditAttribution: deepali_agarwal commentedFunctionality to add multiple rules for different themes on specific set of pages for specific roles is added in latest branch.
Comment #13
deepali_agarwal CreditAttribution: deepali_agarwal commentedAdded support for Multi domain & Multilingual sites.
Comment #14
deepali_agarwal CreditAttribution: deepali_agarwal commentedComment #15
RumyanaRuseva CreditAttribution: RumyanaRuseva at FFW commentedManual review:
Latest release of the module seems to work ok, all errors have been fixed. Code is clean and it follows Drupal standards.
The configuration is simple and intuitive, the module does exactly what it's supposed to do.
Comment #16
kscheirerThanks for your contribution, deepali_agarwal!
I updated your account so you can opt into security advisory coverage now.
I did not find any security issues in your project. My only comment would be that you can simplify some of the boolean logic in PageThemeNegotiator::applies() you have several lines like:
can be replaced with:
Here are some recommended readings to help with excellent maintainership:
You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and stay involved!
Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.
Thanks to the dedicated reviewer(s) as well.