Postponed on #3225243: Add cookies input filter for blocking iframes and other relevant external embeds and scripts
Problem/Motivation
Currently, the Cookies Overlay text is created through
$textbox.text(Drupal.t('This content is blocked because @service cookies have not been accepted.',
{'@service': serviceName}));in javascript. Instead, we should let the admin define the cookies overlay message on creation of a cookies service. This has the advantage, that the admin can exactly define, what the user accepts, if he opts in to the cookie service. This could be relevant for the user rights in some countries.
Proposed resolution
Let the admin define the cookies overlay message on creation of a cookies service.
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | Selection_999(640).png | 45.58 KB | gilmord |
| #10 | Selection_999(641).png | 17.22 KB | gilmord |
| #10 | Selection_999(639).png | 47.95 KB | gilmord |
| #10 | Selection_999(638).png | 13.3 KB | gilmord |
| #10 | Selection_999(637).png | 26.48 KB | gilmord |
Issue fork cookies-3295271
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
anybodyThanks @Grevil, indeed I think a custom summary text would help here and if entered, should be shown instead of the default text in the cookiesOverlay. The cookiesOverlay should get the text based on the service name (pull).
Before implementing this, we should be sure about the label / naming and if the text should also be shown in the cookie layer for the given service, not to clash with the "Documentation" text.
Also we should wait until #3225243: Add cookies input filter for blocking iframes and other relevant external embeds and scripts is finally committed.
Comment #3
grevil commentedOk, so as discussed, we should add a textarea "Summary (for COOKiES Overlay)" in the Cookies Service Form and if that text is empty, we will use the default Cookies text as used before. Also group and describe it, so third parties will easily understand, what the field is for.
Comment #4
osopolarAs #3225243: Add cookies input filter for blocking iframes and other relevant external embeds and scripts was added, this probably should be unblocked now.
IMHO the most important thing is to not use the machine name for the cookies overlay message. Currently I get "This content is blocked because Embedded_content cookies have not been accepted." with the button text "Only accept Embedded_content cookies". It will look much better if at least the human name/label is used instead of ucfirst(serviceName).
Comment #7
gilmordHi @Grevil @Anybody
Please check the MR attached, provided implementation allows to:
- configure placeholder text (top, "accept all" button and bottom text)
- it force usage of service labels in the placeholder instead of machine name
Placeholder texts configured in the global form, I think having it on the service level will be an overkill.
Having it configurable you can prepare a text to match any service.
If we really need the ability to have it on the service level - I would say we should keep the global one and allow users per-service override
Maybe we should keep it as a separate issue for later, so we can merge the current implementation.
Comment #8
gilmordHi again, updated MR with functionality to override placeholder text per-service with fallback to the default configuration text.
Comment #9
anybody@gilmord tests are failing.
Could you please add screenshots what's the actual / planned result? As there are multiple services, I don't really get your idea here.
Comment #10
gilmordHi @Anybody, here is what was done in the MR:
Part 1: use the service name instead of the machine name in the placeholder.
We have a service with the label "Some nice Video service label" and with the machine name "video"
Before this patch the placeholder looks like this (capitalized machine name):

With the patch (the label is used):

Part 2: allow to override of the placeholder texts
The functionality in the merge requests provides two ways to override the text for the placeholder.
Option 1: global settings on the /admin/config/cookies/texts page:


Option 2: each service can override the text for the placeholder:


All the data (texts and labels) passed as drupalSettings:

Comment #11
gilmord@Anybody I will check the tests results, probably the tests have to be updated with this functionality.
Comment #12
gilmord@Anybody I missed adding changes to the cookies.texts schema, added it and tests passed now.
Comment #13
anybodyThank you @gilmord, we'll have a closer look asap at the logics and code!
Comment #14
anybodyComment #15
anybodyComment #16
anybodyLet's solve this for 2.x together with the other service changes.
Fits in there very well!
Comment #17
anybodyComment #18
anybodyComment #19
anybody@Grevil this will need your work as part of #3324484: [1.2.x] Revamp templates and add "Disclaimer" dialog text field for cookie details, I guess.
Comment #20
anybodyComment #21
grevil commentedThis will be implemented inside #3324481: Allow for more structured Cookie Service information.
Thanks for the patches @gilmord, I'll change up the code a bit, but the general instinctive is great.