Details an integration available for Cookiebot, built and maintained by Umbraco HQ.
The following configuration is required for the Cookiebot scripts to be loaded correctly:
// CBID = Cookiebot Identifier
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"
CBIDfrom 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
You can use this package as a reference for creating integrations with other providers using scripts:
- 1.Create a new Razor class library for your integration.
- 2.Add partial views where you insert your custom script code.
- 3.Inject the
IConfigurationinterface into your view:
@inject Microsoft.Extensions.Configuration.IConfiguration Configuration.
Configuration[YOUR_SETTINGS_PATH:KEY]to retrieve the required configuration values.
umbraco-marketplace.jsonfile with Marketplace details of the package.