Download the PHP package t3g/usercentrics without Composer
On this page you can find all versions of the php package t3g/usercentrics. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download t3g/usercentrics
More information about t3g/usercentrics
Files in t3g/usercentrics
Package usercentrics
Short Description This extension provides a usercentrics integration into TYPO3.
License GPL-2.0-or-later
Homepage https://extensions.typo3.org/extension/usercentrics/
Informations about the package usercentrics
Usercentrics Integration for TYPO3
This extension integrates Usercentrics (Compliance and Consent Management) into TYPO3.
Compatibility
| Extension | TYPO3 | PHP |
|---|---|---|
| 13.x | 13.4 LTS, 14 | >= 8.2 |
| 12.x | 11.5, 12.4 | >= 7.4 |
| 10.x | 10.4 | >= 7.2 |
Starting with version 13.0.0 the extension is configured through site sets and site settings instead of TypoScript. See the migration notes below.
Installation and Configuration
-
Install the extension from the TER or via composer:
- TER: https://extensions.typo3.org/extension/usercentrics
- Composer:
composer require t3g/usercentrics
-
On every site where you want to use the extension, include the site set
t3g/usercentrics, either in the backend under Site Management > Sites or in the site'sconfig.yaml: - Configure your Usercentrics ID and the scripts to be handled by Usercentrics
in the site settings, either in the backend under
Site Management > Sites > [your site] > Settings or in
settings.yaml:
Note that the configured data processing service names need to match your Usercentrics configuration.
You do not need to set the type or data-usercentrics attributes for the script tags,
the extension will handle that for you.
Usage in Fluid
The extension comes with a custom ViewHelper which can be used to add scripts via Fluid.
The namespace usercentrics is registered globally:
The identifier is the AssetCollector identifier. Using the same identifier twice
injects the script only once.
Integrate Usercentrics with PHP
To add scripts managed by Usercentrics via PHP, replace your previous calls to the
PageRenderer with AssetCollector calls and make sure to set the attributes
type=text/plain and data-usercentrics=<data processing service>.
Example:
Migrating from 12.x to 13.x
The TypoScript static template has been replaced by a site set. TypoScript
configuration under plugin.tx_usercentrics is no longer read.
- Remove the static template Usercentrics Integration from your TypoScript templates.
- Include the site set
t3g/usercentricsfor every site that uses the extension. - Move your
plugin.tx_usercentricsTypoScript into the site settings. The structure is the same, except that the numbered TypoScript keys (10,20, …) become YAML list entries.
Before (TypoScript):
After (settings.yaml):
Development
A DDEV environment is included. It declares the container only, the installation itself is not part of this repository:
Two things about that command: the admin password has to satisfy TYPO3's policy,
so it needs an upper case character, a digit and a special character, and the
whole thing has to stay on one line, because ddev exec joins its arguments
before handing them to the shell in the container.
The ddev restart is needed once: DDEV decides whether to write
config/system/additional.php by looking for an installed TYPO3, and that check
runs before the dependencies exist on a fresh clone. That file is generated and
stays out of the repository, like everything else below config/.
To look at the extension rendering, point the site at the demo set shipped in
Build/usercentrics_demo. It is a development-only extension providing the page
TypoScript and a Fluid template that uses the ViewHelper, and it is never
released, because Build/ is export-ignored.
-
In
config/sites/main/config.yaml, replace thedependencies: { }that--create-sitewrote with: -
Delete
config/sites/main/setup.typoscript.--create-sitewrites a welcome page into it, and site TypoScript is applied after the site sets, so it would override the demo rendering. - Configure the extension in
config/sites/main/settings.yaml, as documented further up, and runddev exec typo3 cache:flush.
The page then registers scripts both ways the extension offers: two through the
site settings and three through the ViewHelper. View the page source and check
that each one carries type="text/plain" and a data-usercentrics attribute.
| URL | What it shows |
|---|---|
| https://ext-usercentrics.ddev.site/ | Demo page, English |
| https://ext-usercentrics.ddev.site/de/ | Same page in German, once a second language is configured, to check the current language |
| https://ext-usercentrics.ddev.site/typo3 | Backend |
Tests and checks
The functional suite does not use the demo environment above. It builds its own instance, writes its own site configuration and renders through it.
The functional suite needs a database. Inside DDEV it uses the MariaDB container
via the credentials in .ddev/config.yaml; CI runs it on SQLite by setting
typo3DatabaseDriver=pdo_sqlite.
Switching the TYPO3 version
The dump-autoload is required: switching majors in place leaves a class alias
loader generated for the other one, and PHP then fails before the autoloader runs.