Problem/Motivation

It can be useful to know whether cookiebot is active on the current page, to be able to do things like hiding content until cookies are accepted (see e.g. https://support.cookiebot.com/hc/en-us/articles/360003790854-Iframe-cook...). Currently, there is no way to check that, short of replicating the logic from cookiebot_page_attachments_alter().

Proposed resolution

  • Move the logic from cookiebot_page_attachments_alter() to a separate service, allowing other code to call it as well (possibly use some sort of static caching to not have to repeat all checks)
  • Add a hook_preprocess() that injects a variable based on this logic in all templates

Remaining tasks

  • Build
  • Review
  • Merge

User interface changes

None.

API changes

  • A new API call to check for cookiebot status is available
  • A new template variable is available for testing cookiebot status

Data model changes

None

Comments

eelkeblok created an issue. See original summary.

eelkeblok’s picture

Issue summary: View changes