You are here

eu_cookie_compliance_popup_info.html.twig in EU Cookie Compliance (GDPR Compliance) 8

This is a template file for a banner prompting user to give their consent for the website to set cookies.

When overriding this template it is important to note that jQuery will use the following classes to assign actions to buttons:

agree-button - agree to setting cookies find-more-button - link to an information page

Variables available:

  • message: Contains the text that will be display whithin the banner
  • agree_button: Label for the primary/agree button. Note that this is the primary button. For backwards compatibility, the name remains agree_button.
  • disagree_button: Contains Cookie policy button title. (Note: for historical reasons, this label is called "disagree" even though it just displays the privacy policy.)
  • secondary_button_label: Contains the secondary button label. The current action depends on whether you're running the module in Opt-out or Opt-in mode.
  • primary_button_class: Contains class names for the primary button.
  • secondary_button_class: Contains class names for the secondary button (if visible).
  • cookie_categories: Contains a array with cookie categories that can be agreed or disagreed to separately.
  • save_preferences_button_label: Label text for a button to save the consent preferences. category cannot be unchecked.
  • privacy_settings_tab_label: Label text for the Privacy settings tab.
  • withdraw_button_on_info_popup: Show the withdraw button on this popup.
  • method: Chosen consent method.

File

templates/eu_cookie_compliance_popup_info.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * This is a template file for a banner prompting user to give their consent for
  5. * the website to set cookies.
  6. *
  7. * When overriding this template it is important to note that jQuery will use
  8. * the following classes to assign actions to buttons:
  9. *
  10. * agree-button - agree to setting cookies
  11. * find-more-button - link to an information page
  12. *
  13. * Variables available:
  14. * - message: Contains the text that will be display whithin the banner
  15. * - agree_button: Label for the primary/agree button. Note that this is the
  16. * primary button. For backwards compatibility, the name remains agree_button.
  17. * - disagree_button: Contains Cookie policy button title. (Note: for historical
  18. * reasons, this label is called "disagree" even though it just displays the
  19. * privacy policy.)
  20. * - secondary_button_label: Contains the secondary button label. The current
  21. * action depends on whether you're running the module in Opt-out or Opt-in
  22. * mode.
  23. * - primary_button_class: Contains class names for the primary button.
  24. * - secondary_button_class: Contains class names for the secondary button
  25. * (if visible).
  26. * - cookie_categories: Contains a array with cookie categories that can be
  27. * agreed or disagreed to separately.
  28. * - save_preferences_button_label: Label text for a button to save the consent
  29. * preferences.
  30. * category cannot be unchecked.
  31. * - privacy_settings_tab_label: Label text for the Privacy settings tab.
  32. * - withdraw_button_on_info_popup: Show the withdraw button on this popup.
  33. * - method: Chosen consent method.
  34. */
  35. #}
  36. {% if privacy_settings_tab_label %}
  37. <button type="button" class="eu-cookie-withdraw-tab">{{ privacy_settings_tab_label }}</button>
  38. {% endif %}
  39. {% set classes = [
  40. 'eu-cookie-compliance-banner',
  41. 'eu-cookie-compliance-banner-info',
  42. 'eu-cookie-compliance-banner--' ~ method|clean_class,
  43. ] %}
  44. <div role="alertdialog" aria-labelledby="popup-text" {{ attributes.addClass(classes) }}>
  45. <div class="popup-content info eu-cookie-compliance-content">
  46. <div id="popup-text" class="eu-cookie-compliance-message">
  47. {{ message }}
  48. {% if more_info_button %}
  49. <button type="button" class="find-more-button eu-cookie-compliance-more-button">{{ more_info_button }}</button>
  50. {% endif %}
  51. </div>
  52. {% if cookie_categories %}
  53. <div id="eu-cookie-compliance-categories" class="eu-cookie-compliance-categories">
  54. {% for key, category in cookie_categories %}
  55. <div class="eu-cookie-compliance-category">
  56. <div>
  57. <input type="checkbox" name="cookie-categories" id="cookie-category-{{ key }}"
  58. value="{{ key }}"
  59. {% if category.checkbox_default_state in ['checked', 'required'] %} checked {% endif %}
  60. {% if category.checkbox_default_state == 'required' %} disabled {% endif %} >
  61. <label for="cookie-category-{{ key }}">{{ category.label }}</label>
  62. </div>
  63. {% if category.description %}
  64. <div class="eu-cookie-compliance-category-description">{{ category.description }}</div>
  65. {% endif %}
  66. </div>
  67. {% endfor %}
  68. {% if save_preferences_button_label %}
  69. <div class="eu-cookie-compliance-categories-buttons">
  70. <button type="button"
  71. class="eu-cookie-compliance-save-preferences-button">{{ save_preferences_button_label }}</button>
  72. </div>
  73. {% endif %}
  74. </div>
  75. {% endif %}
  76. <div id="popup-buttons" class="eu-cookie-compliance-buttons{% if cookie_categories %} eu-cookie-compliance-has-categories{% endif %}">
  77. <button type="button" class="{{ primary_button_class }}">{{ agree_button }}</button>
  78. {% if secondary_button_label %}
  79. <button type="button" class="{{ secondary_button_class }}">{{ secondary_button_label }}</button>
  80. {% endif %}
  81. </div>
  82. </div>
  83. </div>