DirkPersky / typo3-dp_cookieconsent

TYPO3 Extension: Enable a cookie consent box. Let you visitors control the usage of cookies and load script or content after a consent. (ePrivacy, TTDSG)
GNU Affero General Public License v3.0
32 stars 27 forks source link

Revoke button as text link? #32

Closed djrocher closed 4 years ago

djrocher commented 4 years ago

I would like to call the revoke function by using a text link (or button) in the footer instead of the revoke button (which overlays with the "To top arrow" on my website).

I mean something like: <a href="#" title="Cookie settings" onclick="FunctionName();return false;">Cookie settings</a>

How would the correct syntax be? And will it work when the revoke function is disabled by using plugin.tx_cookieconsent.settings.revokable = false

By the way: plugin.tx_cookieconsent.settings.revokable = false doesn't work for me (dp_cookieconsent 10.3.0, TYPO3 8.7.30), although it should work (https://github.com/DirkPersky/typo3-dp_cookieconsent/issues/9)? The revoke button does not disappear.

Kind regards and thanks for your extension. The documentation and compatibility with so many TYPO3 versions is great :-)

DirkPersky commented 4 years ago

As i see in CookieConsent is this rule

// revokable is true if advanced compliance is selected
if (this.options.type != 'info') this.options.revokable = true;

.....

// countries that say that all cookie consent choices must be revokable (a user must be able too change their mind)
revokable: [
  'HR', 'CY', 'DK', 'EE', 'FR', 'DE','LV', 'LT', 'NL',  'PT',  'ES'
],

though u cant disable the revoke Button with a extendes Layout.

But u can do it via CSS, and with this onlick event it shoud open again.

window.DPCookieConsent.popup.revokeChoice();
djrocher commented 4 years ago

Thank you, it works! I'm hiding the revoke button by setting .cc-revoke to display: none; (CSS) and use a text link to call the revoke function:

<a href="#" title="Cookie settings" onclick="window.DPCookieConsent.popup.revokeChoice();">Cookie settings</a>

Regarding usability I prefer this way, because the new revoke button (fingerprint) doesn't say what it's for (the Default Cookie Consent Button is still available in the partial CookieRevoke.html).

DirkPersky commented 4 years ago

Okay, i will update it. With the version on my website.