Problem/Motivation
Now that admin paths are part of route definitions:
Option A) ... it would be super useful to have an "Is administrative path" condition plugin in core!
The use-case is not to use path conditions like
admin/
admin/* for cases where conditions are used.
This check isn't really feature-complete for admin paths and kind of ugly. So frequently you end up with something like
/admin
/admin/*
/batch
/node/add*
/node/*/*
/user/*/*
/user/login
/user
...
A bonus would be to also be able to match paths that are shown in the admin theme, based on the theme settings checkbox, for example node edit forms.
Option B) The current workaround is to use "Current theme" = "Gin" (Name of the admin theme)
An alternative to the suggested approach would be to add generic options to the "Current theme" condition:
<Default Theme><Administration Theme>
Conditions like this are frequently used for Blocks, Analytics modules, Contexts, etc. that should only act in the frontend, but never on admin pages.
Would be nice to discuss, which solution is the core maintainers favourite, before we start with the implementation.
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
Issue fork drupal-3482723
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
anybodyLooking forward to your feedback! :)
Comment #3
anybodyComment #4
anybodyComment #6
anybodyFurthermore, I just saw that currently it doesn't seem to be possible to select NO theme in this condition (ignore the condition). So if using "ALL", once saved, the condition is always applied! I found this issue for that: #2783897: Current theme condition plugin should provide an option to match all themes and introduce checkboxes