- π¬π·Greece nkaramicha
This feature is something that we would be interested as well, are there any updates on this?
- π©πͺGermany Anybody Porta Westfalica
FYI: The larger plan for 2.x is to replace the React client by a Vue client: https://github.com/jfeltkamp/cookiesjsr-vue for many reasons (also license and technical). I think that should be done first, combined with other refactorings.
Joachim started the implementation already, as you can see, but there's a lot of work to be done in this module and our small 3 person DROWL team is super busy for the next months. Joachim and we invested many development weeks into this module, so anyone who's interested in the future of the COOKiES module should consider helping or sponsoring to put this on more shoulders.
Thank you!
- πͺπΈSpain cbccharlie
Hi,
While the new VUE-based JS library is not available, we have implemented a small JS script that renders any HTML that is embedded in the banner. It is a completely provisional solution, but it can help those of us who have this need get through it. I'm only contributing it in case someone finds it useful, but it's still minimally tested.
(function (Drupal, once) { 'use strict'; Drupal.behaviors.myCustomCookies = { attach(context, settings) { once('myCustomCookies', 'body', context).forEach(function (element) { const observer = new MutationObserver((mutations, obs) => { const cookiesBannerText = document.getElementsByClassName('cookiesjsr-banner--text'); if (cookiesBannerText[0]) { const parser = new DOMParser(); const textarea = document.createElement('textarea'); textarea.innerHTML = cookiesBannerText[0].innerHTML; const cookiesBannerHTML = parser.parseFromString(textarea.value, 'text/html'); cookiesBannerText[0].innerHTML = cookiesBannerHTML.firstChild.innerHTML; obs.disconnect(); } }); observer.observe(document.body, { attributes: true, childList: true, subtree: true }); }); }, }; }(Drupal, once));
In addition to this, it would be necessary to define the library and load it with the component.
Thanks!
- Assigned to jfeltkamp
- π©πͺGermany Anybody Porta Westfalica
@jfeltkamp is this already fixed? Could you give us an update on the status or plan? Should this be a blocker for stable 2.0.0?
- π©πͺGermany jfeltkamp Hamburg
From the side of the JS-library it is fixed.
But now I want to add HTML editors for the fields in the Drupal config forms, so that this would work out of the box. - π©πͺGermany Anybody Porta Westfalica
Nice, thank you @jfeltkamp! :) Looking forward to that! Should you need assistance, feel free to ping us.