- Issue created by @Anybody
Klaro currently uses regular expressions to define paths where the consent manager should appear or not.
I think the reason might be, that the condition is checked cliend-side in JS.
Using regular expressions for paths in Drupal is very untypical and hard for non-developers. Instead you'd expect paths syntax like /path/*
known from blocks and other core / contrib modules.
While I think the functionality needs to be kept, I think it would make sense to exclude certain pages from Klaro entirely, for example /admin/*
One way to do this would be to just add a textarea with one exclusion per line.
But by far more flexible would be to use Drupals Condition Plugin API (which sadly is not very well documented).
https://www.previousnext.com.au/blog/using-drupal-8-condition-plugins-api (or for example look into https://git.drupalcode.org/project/posthog/-/blob/1.x/modules/posthog_js...
Conditions then couldn't only by paths, but also Theme, Language, Roles, ... etc. that can also be added by contrib modules.
But danger, mind this core bug:
🐛
Drupal Current theme condition plugin should provide an option to select all themes
Needs review
Active
3.0
Code