定制 oliverkroener/ok-cookiebot 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

oliverkroener/ok-cookiebot

Composer 安装命令:

composer require oliverkroener/ok-cookiebot

包简介

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

README 文档

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

统计信息

  • 总下载量: 5
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: JavaScript

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2024-09-24

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固