The purpose of a container is to encapsulate all the data (entities
, components
, translations
) we need to build a preference center.
Each containers need to follow the same structure. A container contains an ID, entities list and layout, components list and layout as well as translations. It also allows you to only have one Didomi Element in your HTML page and generate your entire preference center from the didomiConfig
object.
A container object needs to be added in the containers
array of the didomiConfig
object and contains an ID to be configured properly:
window.didomiConfig = {containers: [{id: "my-first-container"components: {},entities: {},translations: []}]};// In your HTML, where you want to display the elements<didomi-container id="my-first-container"></didomi-container>
Feel free to rename my-first-container
with something more personalized.
Now that we have the base of our structure, let's continue by creating our entities.