Details an integration available for Cookiebot, built and maintained by Umbraco HQ.
This integration provides an implementation model for the Cookiebot banner and declaration.
Major | Minor/Patch |
---|---|
The following configuration is required for the Cookiebot scripts to be loaded correctly:
The package is a reusable Razor class library that will allow editors to load the Cookiebot Banner and Declaration scripts.
The banner script needs to be inserted as the first script of the website, by placing it within the <head></head>
tag using this syntax:
The Declaration script can be added to whatever page you want, using this syntax:
Both scripts "pick up" CBID
from the website's configuration file and update the details accordingly.
This integration demonstrates how an Umbraco package can be used as an integration with a script-based provider, using partial views and the IConfiguration
interface.
You can use this package as a reference for creating integrations with other providers using scripts:
Create a new Razor class library for your integration.
Add partial views where you insert your custom script code.
Inject the IConfiguration
interface into your view: @inject Microsoft.Extensions.Configuration.IConfiguration Configuration
.
Use Configuration[YOUR_SETTINGS_PATH:KEY]
to retrieve the required configuration values.
Add umbraco-marketplace.json
file with Marketplace details of the package.
Once your integration is ready, all that remains to do is to deploy the package to NuGet.
Version 10
10.0.0
Version 11
11.0.0