Download the PHP package oliverkroener/ok-prive-consent without Composer

On this page you can find all versions of the php package oliverkroener/ok-prive-consent. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package ok-prive-consent

Prive Consent (ok_prive_consent)

TYPO3 14 PHP 8.2+ License: GPL v2+ Version

TYPO3 backend module for managing Prive Cookie Consent banner scripts.

Features

Requirements

Installation

Composer (recommended)

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. In the backend it appears under Site Management > Sites as [kroener.DIGITAL] Prive Consent.

The set is empty in every respect -- dependencies: [], a comments-only setup.typoscript, and no settings.definitions.yaml. You may keep the dependency or delete it from your site's config.yaml; the banner renders either way, because the event listener is registered through Services.yaml rather than through the set.

Usage

  1. Navigate to Web > Prive in the TYPO3 backend (the module header reads Prive Settings)
  2. Select a page in the page tree (the module resolves the site root automatically)
  3. Toggle Enable Prive script to activate/deactivate the banner
  4. Paste the JavaScript snippet from your Prive dashboard
  5. 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

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)
MigrateConsentStorageToPagesUpgradeWizard Classes/Upgrades/ #[UpgradeWizard('okPriveConsentMigrateStorageToPages')]; copies sys_template values onto the site root page
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)

File structure

Database fields (on pages)

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.

Upgrading from installations that stored on sys_template

Earlier versions kept both fields on the sys_template record of the site root page. Sites configured with site sets have no sys_template record, so the module could not find any storage and showed "Please select a root site or a page that contains a site root and template!". The settings now live on the site root pages record.

After updating, run the database analyser and then the upgrade wizard "EXT:ok_prive_consent: Move consent banner settings from sys_template to pages" (Admin Tools → Upgrade, or vendor/bin/typo3 upgrade:run okPriveConsentMigrateStorageToPages) to copy existing values over.

Frontend rendering order

The listener injects the markup before </body> in this order to ensure correct DOM timing:

  1. CSS -- cookie button stylesheet loaded via <link> tag
  2. Cookie button -- <a> element with data-cc="c-settings" attribute
  3. 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:

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.


All versions of ok-prive-consent with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
typo3/cms-core Version ^14.3
typo3/cms-backend Version ^14.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package oliverkroener/ok-prive-consent contains the following files

Loading the files please wait ...