In more recent template updates, categories that contain no cookies do not appear. Visitors need only consent to active cookie categories.
Suppose you would like to have all categories displayed on your pop-up. In that case, you need to remove the IF statement controlling this located in the HTML of the consent pop-up.
Note: If the scanner could not scan your website, all of the cookie categories will not show since there are no cookies in any of the categories. And the pop-up might appear to have missing toggles.
You can first see the Overlay V2 pop-up template with all cookie categories shown in the example below. Then, the other one with empty cookie categories is autohidden from the pop-up text (1) and the toggles (2).
Show all cookie categories
First, let's show all cookie categories in the pop-up text.
Go to the consent solution that contains the pop-up you wish to edit.
Click on the Copy and translations tab -> "Pop-up" field
Replace
<ol class="coi-purpose-list"></ol>
with<ol><li>Funktionalitet</li><li>Statistik</li><li>Marketing</li></ol>
Then, we need to show all toggles.
Start by going to the consent solution that contains the pop-up you wish to edit. From there click on the Pop-up appearance tab - Advanced Settings - HTML field (the first of the three boxes).
Scroll down the field until you see the following line:
{{#each cookie_categories}}
Directly below, you should see:
{{#if this.cookie_type_count}}
Remove the line, and then continue further down until you find the end of the IF statement:
{{/if}}
{{/each}}
Remove the {{/if}}
This needs to be done on both instances of #{{each cookie_categories}}.
Once you have made your changes, remember to click "Save and Publish" so they take effect.
Autohide empty cookie categories
Please use this guide to remove a category in which you do not have any cookies.
First, let's hide all empty cookie categories in the "Pop-up text".
Go to the consent solution that contains the pop-up you wish to edit.
Click on the Copy and translations tab -> "Pop-up" field
Replace
<ol><li>Funktionalitet</li><li>Statistik</li><li>Marketing</li></ol>
with<ol class="coi-purpose-list"></ol>
Then, we need to hide the toggles.
These changes will be made in the Consent Solution - Pop-up appearance - Advanced Settings - HTML.
To remove categories that do not contain any cookies, you need to add this code snippet:
#{{#if this.cookie_type_count}}
right after the
#{{#each cookie_categories}}
And close the if statement with
#{{/if}}
right before
#{{/each}}
This should be done on both instances of #{{#each cookie_categories}}.
Expand or minimise the mobile view
In Overlay v2 and Overlay v3 pop-up templates version 1.1.0 we introduced a new minimised mobile view. The minimised view is set by default and can be expanded by clicking on the expand arrow button at the top.
If you would like to change that functionality and have the view to be expanded for your mobile users by default you would need to make the following changes.
1. Under the "Advanced Options" on the "Copy and translations" tab locate the following code in the HTML part:
<div role="dialog" tabindex="-1" aria-modal="true" id="coi-banner-wrapper" class="coi-banner__wrapper" aria-describedby="coiBannerHeadline" aria-labelledby="coi-banner-wrapper_label" lang="{{language}}" dir="ltr">
2. Replace the code with the following:
<div role="dialog" tabindex="-1" aria-modal="true" id="coi-banner-wrapper" class="coi-banner__wrapper coi_expanded" aria-describedby="coiBannerHeadline" aria-labelledby="coi-banner-wrapper_label" lang="{{language}}" dir="ltr">
If you have the expanded mobile view by default and would like to have it minimised make sure you have updated to our latest Overlay v2 or Overlay v3 template.
Related articles: