Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Banner is displayed only once, html is escaped #83

Open
zsso opened this issue Sep 16, 2021 · 7 comments
Open

Banner is displayed only once, html is escaped #83

zsso opened this issue Sep 16, 2021 · 7 comments

Comments

@zsso
Copy link

zsso commented Sep 16, 2021

Thanks for the plugin. I tried to install it, but I have some issues.

  1. The banner is displayed only, even if I don't click Decline or Accept, jut go to Advanced Settings.
  2. On Advanced Settings page, html is escaped. I tried with October CMS Demo theme. Please have a look at screenshot.
    html_escaped
@tobias-kuendig
Copy link
Member

The banner is displayed only, even if I don't click Decline or Accept, jut go to Advanced Settings.

Did you include jQuery and October's JS Framework?
https://octobercms.com/docs/ajax/introduction#framework-script

On Advanced Settings page, html is escaped. I tried with October CMS Demo theme. Please have a look at screenshot.

Did you override any partials? Content like the contact details are passed through the | raw filter and should therefore not be escaped:

https://github.com/OFFLINE-GmbH/oc-gdpr-plugin/blob/develop/components/cookiemanager/details.htm#L37

@zsso
Copy link
Author

zsso commented Sep 17, 2021

The banner is displayed only, even if I don't click Decline or Accept, jut go to Advanced Settings.

Did you include jQuery and October's JS Framework?
https://octobercms.com/docs/ajax/introduction#framework-script

Yes, it is included, ajax is working.

On Advanced Settings page, html is escaped. I tried with October CMS Demo theme. Please have a look at screenshot.

Did you override any partials? Content like the contact details are passed through the | raw filter and should therefore not be escaped:

https://github.com/OFFLINE-GmbH/oc-gdpr-plugin/blob/develop/components/cookiemanager/details.htm#L37

I did not override anything.
I just tried, that if I change: {{ html_clean(cookie.contact_details_dpo | raw) }} to {{ cookie.contact_details_dpo | raw }} it works as expected.

@dathwa
Copy link

dathwa commented Oct 20, 2021

Similar issue. The html is not rendering correct. I have not touched the partial. no over-rides. see https://prnt.sc/1wtk6zj

same solution works for me I just tried, that if I change: {{ html_clean(cookie.contact_details_dpo | raw) }} to {{ cookie.contact_details_dpo | raw }}

@mediaclinic
Copy link
Contributor

Same issue with html not rendering correct. Html is escaped. Also, banner is displayed only once. It seems to conflict with some JS.

VM54:1 Uncaught SyntaxError: Unexpected token ':'

@zsso
Copy link
Author

zsso commented Nov 25, 2021

Regarding the "Banner is displayed only once" issue, it only happens if I open Advanced options page. Cookie gdpr_cookie_consent is added when that page is opened, without accepting anything. Can you give me a hint how to turn it off?

@tobias-kuendig
Copy link
Member

This is by design. The banner component only allows cookies if the user explicitly clicks "accept". If "go to settings" is selected, the user had the chance to choose the accepted cookies. If nothing is explicitly selected, the banner should not be displayed over and over again.

To disable this behaviour, remove these two lines and do the redirect to the settings page using a simple a tag:
https://github.com/OFFLINE-GmbH/oc-gdpr-plugin/blob/develop/components/cookiebanner/settings.htm#L4-L5

@zsso
Copy link
Author

zsso commented Nov 25, 2021

This is by design. The banner component only allows cookies if the user explicitly clicks "accept". If "go to settings" is selected, the user had the chance to choose the accepted cookies. If nothing is explicitly selected, the banner should not be displayed over and over again.

To disable this behaviour, remove these two lines and do the redirect to the settings page using a simple a tag: https://github.com/OFFLINE-GmbH/oc-gdpr-plugin/blob/develop/components/cookiebanner/settings.htm#L4-L5

Thank you for the fast answer!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants