- Issue created by @thomas.frobieter
- 🇫🇷France racol
Good idea,
but I didn't want my module to depend on another one but only on Drupal core (easy install, anyway, you know :) ).
I use it on many of my sites and no dependencies are needed other than Drupal core.
The simplest solution is often the best :)!
I will of course think about it but to be honest with you, as long as it works ... ^^, I am interested in other subjects.
I will focus more on taxonomy search admin form (" https://www.drupal.org/project/taxonomy_search_admin_form → "), it seems quite appreciated by the community.
It goes without saying that I continue to take care of the two modules which are being proofread by ... me. And a "News" module similar to an X (Twitter) or Facebook for Drupal 9|10; finished but not tested on a large scale (only 1000 users on a dedicated server).
Looking forward to giving you access to the contribution on GIT for:
- https://git.drupalcode.org/project/taxonomy_search_admin_form
- https://git.drupalcode.org/project/switch_themepleasure
- Assigned to racol
but I didn't want my module to depend on another one but only on Drupal core (easy install, anyway, you know :) ).
Ah sorry, this was not the idea. I am pretty happy that it doesn't depend on Theme Switcher Rules, because it does not worked well for my case.
I just thought its worth looking at its code for the configuration page links to quickly fix this.
To clearify this, I am talking about the missing settings/"configure" links one the module page and in the admin menu - sorry for the German UI:
Looking forward to giving you access to the contribution on GIT for:
I am frontend/theme developer, so I doubt that I am very helpful on the backend coding side :/
- 🇫🇷France racol
sorry for the German UI
Don't worry ;), I added a configuration link (attachment 1.png) in "admin/module" list for the custom module Switch theme. This link redirects to the list of switch theme available (attachment 2.png), what do you think ?
Furthermore, I haven't tested completely your case of query parameter for the Switch Theme, a release should be available tomorrow :)
Pleasure
Don't worry ;), I added a configuration link (attachment 1.png) in "admin/module" list for the custom module Switch theme. This link redirects to the list of switch theme available (attachment 2.png), what do you think ?
Perfect!
Furthermore, I haven't tested completely your case of query parameter for the Switch Theme, a release should be available tomorrow :)
Sounds Nice! I am happy to test this, just trigger me (:
- 🇫🇷France racol
Sorry, I'm late. So I released the version 1.2.0 of Switch Theme including:
- Configuration link directly on modules list & Appearance tab
- Allowed query parameters in regex theme configuration
- Some others corrections on others subjects
To have it, you must uninstall your current version of the module (1.1.0 I think for 1.2.0). If you have a lot of themes configuration, make sure to make a backup of the regex you writed. Don't worry about your website ;)
I advise to you to install the module via composer
composer require 'drupal/switch_theme:^1.2'
For the query parameters, don't forget to escape the "?" character with a "\" ("?" is a special character for regex, so, if you don't escape it, it will be interpreted), below some examples I used for test:
- #^/test\?theme=1$#
- #^/test\?theme=7$#
- #^/test\?theme=1$|^/test\?theme=7$#
I created the article "test" with "/test" alias and applied different themes according to the query parameters
- #^/test\?theme=1$# => only the theme for the role & regex choosed is applied
- #^/test\?theme=7$# => only the theme for the role & regex choosed is applied
- #^/test\?theme=1$|^/test\?theme=7$# only the theme for the role & regex choosed is applied
- #^/test\?theme=2$|^/test\?theme=3$|#^/test\?theme=4$ ... # the default theme will be applied
Let me know if this release is good for you ;).
Pleasure
- Status changed to Fixed
over 1 year ago 2:47am 24 August 2023 Awww, so nice!
I'll test this ASAP, hopefully later this day!It seems that a path still is required, right?
I am trying to prevent, that the site-admins need to add each new path as rule, so in my case its more like:
#\?is_embed=1$#
or simply
#\?is_embed$#
- 🇫🇷France racol
You can use
#\?is_embed=1$#
or
#\?is_embed$#In pattern configuration.
You can also create two switch theme if you want both.
I tested it on my local env.
Pleasure
Yeah, tried that too, but if you have something like:
https://example.com/my_super_amazing_webform?is_embed
I don't found a solution yet, but this is very likely (again) about my bad Regex skills -_-
I really won't waste more of your time, helping me with Regex, our developer is back from holidays in a couple of days, so I better waste HIS time ;)
Thank you very, very much for the modifications, I really appreciate this!
- 🇫🇷France racol
Your regexs are corrects ;)
Test to reproduce:
- Create a page my_super_amazing_webform
- URL alias /my_super_amazing_webform
- Create Switch theme with #\?is_embed$#
- Going to http://rcowebdev.local/my_super_amazing_webform?is_embed, choosen theme applied (attachment is_embed.png)
- Going to http://rcowebdev.local/my_super_amazing_webform, default theme applied (attachment not_embed.png)
Pleasure
Automatically closed - issue fixed for 2 weeks with no activity.