dobarkod / cookie-banner

JavaScript based cookie-info banner for complying with EU cookie law
MIT License
425 stars 84 forks source link

Two links in the message possibility #78

Closed fourroses666 closed 6 years ago

fourroses666 commented 6 years ago

I need two links, tried it like you can see here below but that doesn't work. Any idea how to fix this?

data-message="We use cookies ... and our <a href'/privacy'>privacy statement</a> and "
data-linkmsg="cookiestatement"
data-moreinfo="/cookies"
data-moreinfo-target="_parent">
zytzagoo commented 6 years ago

The first a element inside message will be linked to moreinfo, rest is untouched and will be left as-is if provided inside data-message: https://github.com/dobarkod/cookie-banner/blob/ae1a32bfad4143fdfd66782d0150401e50a9b3d9/src/cookiebanner.js#L500

And you'd have to set data-linkmsg="" in order to not have the default link shown.

So, as a kind of a workaround, this might give you what you want, if I understood correctly: https://codepen.io/anon/pen/jKraxB

If not, please clarify what exactly you wanted to achieve. Hopefully the pen above helps either way.

fourroses666 commented 6 years ago

Thank you! That was my aim.