Problem/Motivation
Toastify is a good fit for our front-end theme, but it's not so welcome in the admin theme (a lightly css-enhanced Claro). We'd like messages in the admin theme to be unaltered.
It doesn't appear to be possible to disable Toastify entirely for a single theme. The class swap in hook_element_plugin_alter() is cached regardless of theme.
Setting toastify/toastify: false in libraries-override results in no messages appearing at all, presumably because the class is swapped and expects the library to be there.
Proposed resolution
A checkbox "Disable for admin theme" in Toastify settings would be great. Not sure how that could be implemented to work with the class swap.
| Comment | File | Size | Author |
|---|
Issue fork toastify-3387703
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
keshavv commentedCreated a patch as per the request, Please review.
Comment #3
dieterholvoet commentedI think it would be better/more flexible to create a setting named 'Enable for' with two checkboxes, 'Admin theme' and 'Frontend theme'. This way the module can also be used only in the admin theme. The two checkboxes should be enabled by default for both new and existing installations, to preserve backwards compatibility.
Comment #4
johnpitcairn commentedOr even add a checkbox to each individual theme's settings. Maybe that's a followup ;-)
Comment #5
dieterholvoet commentedComment #7
sourabhsisodia_ commentedComment #9
sourabhsisodia_ commentedComment #10
tirupati_singh commentedHi, I've applied the provided MR as a patch and it applied cleanly without any errors. After applying the patch, a new configuration field 'Enable for' has been provided to Enable/Disable the module functionality for the Admin Theme or Frontend Theme. When the Admin Theme option is unchecked then the messaging shown is unaltered. The provided new field functionality is working fine. I'm attaching the screenshots of the before and after fixes for reference and moving the issue to RTBC.
Thanks!
Comment #13
dieterholvoet commented