oliverkroener/ok-prive-consent
Composer 安装命令:
composer require oliverkroener/ok-prive-consent
包简介
Provides a backend module to manage privacy cookie consent scripts for Prive Cookie Consent.
关键字:
README 文档
README
TYPO3 backend module for managing Prive Cookie Consent banner scripts.
Features
- Backend module under Web > Prive Consent for editing consent scripts
- Enable/disable toggle to activate or deactivate the banner without removing the script
- Multi-site support -- automatically resolves the correct site root per TYPO3 site configuration
- Unsaved changes protection -- warns before navigating away with unsaved modifications (with "save and close" support)
- Automatic frontend rendering -- script and cookie settings button injected before
</body>by a PSR-14 event listener (no TypoScript or template changes required) - Cache flush on save -- frontend page cache is cleared automatically after saving
- Cookie settings button -- fixed-position floating button with SVG cookie icon for visitors to reopen consent dialog
Requirements
- TYPO3 14.3 LTS
- PHP >= 8.2 (8.2–8.5)
Installation
Composer (recommended)
composer require oliverkroener/ok-prive-consent
Extension Manager
Download or upload the extension and activate it via Admin Tools > Extensions.
No site set required
The consent banner renders automatically on every frontend page once the extension is
installed -- it is injected by a PSR-14 event listener registered through the extension's
Services.yaml. No site set, TypoScript, or template change is needed.
A site set named oliverkroener/ok-prive-consent is still shipped (so existing site
configurations that reference it under dependencies keep working), but it is now a
no-op and entirely optional.
Usage
- Navigate to Web > Prive Consent in the TYPO3 backend
- Select a page in the page tree (the module resolves the site root automatically)
- Toggle Enable Prive script to activate/deactivate the banner
- Paste the JavaScript snippet from your Prive dashboard
- Click Save
The consent script and a cookie settings button are rendered automatically in the page footer on all frontend pages.
Configuration
The extension works out of the box once installed -- the banner is injected by the event
listener with no further configuration. To customise the cookie settings button, override
the styles from Resources/Public/Css/prive-cookie-button.css in your site package.
Brand colours: primary #f05722, secondary #0fa8dd.
Architecture
TYPO3 Backend --> ConsentController --> sys_template table
|
ModuleTemplateFactory,
SiteFinder, ConnectionPool
(TYPO3 core)
Frontend --> AfterCacheableContentIsGeneratedEvent
|
InjectBannerScript (listener) --> DatabaseService --> sys_template table
| |
inject before </body> SiteFinder (TYPO3 core)
| Component | Path | Description |
|---|---|---|
ConsentController |
Classes/Controller/Backend/ |
PSR-7 controller (#[AsController]) with indexAction and saveAction |
InjectBannerScript |
Classes/EventListener/ |
PSR-14 listener on AfterCacheableContentIsGeneratedEvent; splices the banner markup before </body> |
DatabaseService |
Classes/Service/ |
Resolves the site and builds the banner markup via getBannerMarkup(ServerRequestInterface) |
| Module registration | Configuration/Backend/Modules.php |
Declarative backend module under Web menu with page tree navigation |
| Icon registration | Configuration/Icons.php |
SVG module icon via SvgIconProvider |
| JavaScript modules | Configuration/JavaScriptModules.php |
ES6 module mapping for @oliverkroener/ok-prive-consent/ |
| Dependency injection | Configuration/Services.yaml |
Autowiring + autoconfigure (the event listener is auto-registered via #[AsEventListener]) |
| Site set | Configuration/Sets/OkPriveConsent/ |
config.yaml + no-op setup.typoscript; kept only so existing site-config references stay valid |
| Fluid templates | Resources/Private/Templates/Backend/Consent/ |
Index.html -- form with three states (no page, no site, edit) |
| FormDirtyCheck | Resources/Public/JavaScript/backend/ |
ES6 module for unsaved changes detection with ConsumerScope integration |
| Localisation | Resources/Private/Language/ |
English (locallang.xlf) and German (de.locallang.xlf) |
Database fields (on sys_template)
| Field | Type | Description |
|---|---|---|
tx_ok_prive_cookie_consent_banner_script |
text | The JavaScript consent snippet |
tx_ok_prive_cookie_consent_banner_enabled |
boolean | Enable/disable toggle |
The fields are declared in ext_tables.sql and read/written exclusively via QueryBuilder
from the backend module (there is no TCA definition). Field names retain the original
ok_prive_cookie_consent prefix for backward compatibility with existing data.
Frontend rendering order
The listener injects the markup before </body> in this order to ensure correct DOM timing:
- CSS -- cookie button stylesheet loaded via
<link>tag - Cookie button --
<a>element withdata-cc="c-settings"attribute - Prive script -- the consent JavaScript snippet (so it can bind to the button already in DOM)
Injecting via a PSR-14 event listener (rather than a TypoScript page.footerData USER object)
makes rendering independent of site-set load order: a theme set that re-declares page = PAGE
after this extension can no longer discard the banner. The markup is part of the cacheable page
content, so it is stored in the page cache.
Documentation
Full documentation is available in the Documentation/ directory. Generate rendered docs locally with:
make docs
This uses the official TYPO3 Documentation rendering container.
License
GPL-2.0-or-later
Author — Oliver Kroener
Automated. Scaled. Done.
Web3 · Cloud · Automation
Technology is only valuable when it solves a real problem. For over 30 years I've been translating between business and tech — so your investment in digitalisation doesn't stall at proof-of-concept but delivers measurable results.
- Website: oliver-kroener.de
- Web3: web3.oliver-kroener.de
- Email: ok@oliver-kroener.de
- Web3 Email: oliverkroener@ethermail.io
oliverkroener/ok-prive-consent 适用场景与选型建议
oliverkroener/ok-prive-consent 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 42 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 02 月 13 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「typo3」 「privacy」 「cookie-consent」 「gdpr」 「typo3-extension」 「consent-management」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 oliverkroener/ok-prive-consent 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 oliverkroener/ok-prive-consent 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 oliverkroener/ok-prive-consent 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Make TYPO3 more compatible to GDPR
Set Links with a specific language parameter
A simple cookie consent module for magento. It relies on new GTM consent functionality.
TYPO3 CMS extension to create gallery content element with preset crop ratios and pagination
Cookie consent for Laravel
Make your Laravel app comply with the crazy EU cookie law
统计信息
- 总下载量: 42
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 37
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0-or-later
- 更新时间: 2026-02-13