Skip to content

How to show privacy policy page linked from the footer when disablePageInteraction is true? #658

Answered by orestbida
akosphp asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @akosphp,

you need to differentiate the privacy policy page from the other pages.

There are many ways to do this. One approach is to add a simple script tag in the privacy policy page only, and set a unique global variable:

<script>window.isPrivacyPage = true;</script>

The above script must be placed before the plugin's initialization script.
You can then toggle the disablePageInteraction option dynamically like so:

CookieConsent.run({
    /// ...
    disablePageInteraction: !window.isPrivacyPage
});

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@akosphp
Comment options

Answer selected by akosphp
Comment options

You must be logged in to vote
1 reply
@osworx
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants