oliverkroener/ok-cookiebot

Provides a backend module to manage privacy cookie consent scripts for Cookiebot.

Installs: 5

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:typo3-cms-extension

pkg:composer/oliverkroener/ok-cookiebot

dev-main 2026-02-15 03:32 UTC

This package is auto-updated.

Last update: 2026-02-15 03:32:14 UTC


README

TYPO3 12 TYPO3 13 TYPO3 14 License: GPL v2+ Version

TYPO3 extension that provides a backend module to manage Cookiebot cookie consent banner and declaration scripts per site.

Features

  • Backend module under the "Web" section with page tree navigation for managing Cookiebot scripts per site
  • Two script fields: banner script (rendered in <head>) and declaration script (rendered before </body>)
  • Per-site configuration: scripts are stored per site root in sys_template records
  • Automatic frontend rendering via TypoScript USER objects (lib.cookiebotHeadScript / lib.cookiebotBodyScript)
  • Multi-language backend: English and German translations
  • Custom SVG icon for the backend module

Requirements

  • TYPO3 12.4 LTS, 13.4 LTS, or 14.x
  • PHP (no explicit constraint — follows TYPO3 core requirements)

Installation

Composer

composer require oliverkroener/ok-cookiebot

Local path repository

Add to your root composer.json:

{
    "repositories": [
        {
            "type": "path",
            "url": "packages/ok_cookiebot"
        }
    ]
}

Then run:

composer require oliverkroener/ok-cookiebot:@dev

Activate

After installation, include the static TypoScript template [kroener.DIGITAL] Cookiebot in your site's template record.

Configuration

TypoScript

Include the static template to enable automatic frontend script rendering. The extension registers two TypoScript objects:

Object Placement Description
lib.cookiebotHeadScript page.headerData.261487170 Renders the banner script in <head>
lib.cookiebotBodyScript page.footerData.261487170 Renders the declaration script before </body>

Backend Module

  1. Navigate to Web > Cookiebot in the TYPO3 backend
  2. Select a page within a site that has a root template
  3. Paste the Cookiebot banner script (for <head>) and declaration script (for <body>)
  4. Click Save

Scripts are stored in the sys_template record of the site root page via custom fields tx_ok_cookiebot_banner_script and tx_ok_cookiebot_declaration_script.

Architecture

ok_cookiebot/
├── Classes/
│   ├── Controller/Backend/
│   │   └── ConsentController.php      # Backend module controller (index + save)
│   └── Rendering/
│       └── CookiebotScriptRenderer.php # Frontend TypoScript USER renderer
├── Configuration/
│   ├── Backend/Modules.php             # Backend module registration
│   ├── Icons.php                       # SVG icon registration
│   ├── Services.yaml                   # DI autowiring
│   ├── TCA/Overrides/sys_template.php  # Static TypoScript file registration
│   └── TypoScript/setup.typoscript     # Frontend script rendering setup
├── Resources/
│   ├── Private/
│   │   ├── Language/                   # XLIFF translations (en, de)
│   │   └── Templates/Backend/          # Fluid backend templates
│   └── Public/
│       ├── Css/                        # Backend module stylesheets
│       ├── Icons/                      # Extension & module icons
│       └── JavaScript/                 # Backend module JavaScript
└── ext_localconf.php                   # TypoScript setup import

License

GPL-2.0-or-later

Author

Oliver Kroeneroliver-kroener.deok@oliver-kroener.de