Reorder buttons

Created on 18 April 2025, 21 days ago

Hello,

Problem/Motivation

If I well understand your code in eu_cookie_compliance_popup_info.html.twig, the 3 buttons are placed in this order from left to right :
reject - agree - withdraw

Steps to reproduce

First connection, you have 2 buttons : reject - agree
Click "reject" or "agree" or "save the preferences", you now have 2 buttons : agree - withdraw
Click "withdraw", you have again the 2 buttons : reject - agree

Note that the "agree" button is sometimes on the left, sometimes on the right, which could be interpreted by a DPO as an influence or confusion for the user.

Proposed resolution

Reorder the button : "agree - withdraw - reject" ou "agree - reject - withdraw", this way the "agree" button is always on the left and the user is not confused.

Thanks.

Feature request
Status

Active

Version

1.25

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @lucky723
  • 🇳🇿New Zealand atowl

    Hi - testing this, the accept button is always on the left for me?

    Thanks!

  • Hi,
    I've checked again and found no custom code to explain this.
    The buttons are positionned reject-agree-withdraw and "visually-hidden" class is applied to reject or withdraw depending what you click.

    Here is the HTML when withdraw is selected and agree button on the right :

    <div id="popup-buttons" class="eu-cookie-compliance-buttons eu-cookie-compliance-has-categories">
                  <button type="button" class="eu-cookie-compliance-default-button eu-cookie-compliance-reject-button" tabindex="0">Tout rejeter</button>
                <button type="button" class="agree-button eu-cookie-compliance-default-button" tabindex="0">Tout accepter</button>
                  <button type="button" class="eu-cookie-withdraw-button visually-hidden" tabindex="0">Tout refuser</button>
    </div>

    I copy here the settings export in case it would be due to a parameter (I've made several tests but could not find any) :

    _core:
      default_config_hash: EspchZru2hYTTeNNAnTw2uWwT-mjJ46KrM5XEVHJzS0
    langcode: fr
    dependencies:
      config:
        - filter.format.html_ultra
        - filter.format.full_html
    uuid: f5b6d259-c917-49b3-b51a-051f3f3e864e
    popup_enabled: true
    popup_clicking_confirmation: false
    popup_scrolling_confirmation: false
    eu_only: false
    eu_only_js: false
    popup_position: false
    fixed_top_position: true
    popup_info:
      value: "<h2>Ce site utilise des cookies pour améliorer votre navigation.</h2>\r\n\r\n<p>En cliquant sur \"Tout accepter\", vous acceptez l'utilisation de ces cookies.</p>\r\n"
      format: full_html
    mobile_popup_info:
      value: ''
      format: html_ultra
    popup_info_template: new
    popup_agree_button_message: Accepter
    popup_more_info_button_message: 'En savoir plus'
    mobile_breakpoint: 768
    popup_agreed_enabled: false
    popup_hide_agreed: false
    disagree_button_label: 'Je refuse'
    popup_agreed:
      value: "<h2>Merci d'avoir accepté les cookies</h2><p>Vous pouvez désormais masquer ce message ou en apprendre plus à propos des cookies.</p>"
      format: full_html
    popup_find_more_button_message: 'En savoir plus'
    popup_hide_button_message: Hide
    popup_link: /politique-de-protection-des-donnees-personnelles-de-lancv
    popup_link_new_window: true
    popup_height: null
    popup_width: 100%
    popup_delay: 1000
    show_more_info: true
    popup_bg_hex: e8f4f8
    popup_text_hex: 003f7d
    domain: ''
    domains_option: 0
    domains_list: ''
    exclude_paths: ''
    exclude_admin_theme: false
    cookie_session: 0
    set_cookie_session_zero_on_disagree: 0
    cookie_lifetime: 10
    use_mobile_message: false
    use_bare_css: false
    use_olivero_css: false
    disagree_do_not_show_popup: false
    reload_page: true
    reload_options: 0
    reload_routes_list: ''
    cookie_name: Cookies
    exclude_uid_1: false
    better_support_for_screen_readers: true
    method: categories
    disabled_javascripts: ''
    automatic_cookies_removal: true
    allowed_cookies: "cookies_de_statistique:_gid\r\ncookies_de_statistique:_gat_UA-48827688-1\r\ncookies_de_statistique:_gat_gtag_UA_48827688_1\r\ncookies_de_statistique:_ga\r\ncookies_de_statistique:_ga_B0CGR52T91\r\ncookies_publicitaires:__troRUID\r\ncookies_publicitaires:__trossion\r\ncookies_publicitaires:RUID\r\ncookies_de_statistique:ar_debug\r\ncookies_fonctionnels:has_js\r\ncookies_publicitaires:_fbp"
    consent_storage_method: basic
    withdraw_message:
      value: "<h2>Nous utilisons des cookies sur ce site pour améliorer votre expérience d'utilisateur.</h2><p>Vous avez consenti à l'ajout de cookies.</p>"
      format: full_html
    withdraw_tab_button_label: 'Gestion cookies'
    withdraw_action_button_label: 'Tout refuser'
    withdraw_enabled: true
    withdraw_button_on_info_popup: true
    save_preferences_button_label: 'Sauvegarder les préférences'
    accept_all_categories_button_label: 'Tout accepter'
    enable_save_preferences_button: true
    domain_all_sites: true
    settings_tab_enabled: true
    containing_element: body
    cookie_policy_version: 1.0.0
    cookie_value_disagreed: '0'
    cookie_value_agreed_show_thank_you: '1'
    cookie_value_agreed: '2'
    accessibility_focus: true
    close_button_action: close_banner
    reject_button_label: 'Tout rejeter'
    reject_button_enabled: true
    close_button_enabled: false
    

    I can also tell you the url of my site so you can check by your own, but I don't know if it's permitted by rules here.
    Thanks.

Production build 0.71.5 2024