• Resolved Etienne

    (@epipo)


    Hello,

    I am trying to display the Cookie Preference panel with the shortcode (not the showMinimizedButton option) but when I click on the link nothing happen (no error in the console and no panel).

    Here are my logic options settings: https://cloudup.com/c5EMHDIXT6e

    I am on the latest version of WordPress and of your plugin.

    You can view the website here : studiodpe.com (the shortcode is used in the footer with the following text: “Gérer les cookies”).

    Thanks for your help!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Nicola Modugno

    (@shark986)

    Hello @epipo,

    with Chrome I see the following error in console:
    Uncaught TypeError: Cannot read property 'smoothScroll' of null at S (main.min.js:1)

    I also see that the link that should open the panel has been modified. It should be <a href="#" class="OpenCookiePreferences">Gestion des cookies</a> but it is <a href="#cookies" class="OpenCookiePreferences">Gestion des cookies</a>.

    I think that a “scroll plugin” is trying to run some graphic effects on the DOM element with id “cookies”, but there is no element with that id!

    Could you exclude the cookie link from the scroll effect system?

    Nicola

    Thread Starter Etienne

    (@epipo)

    Hello @nicola,

    Thanks for your fast answer! Indeed I have a smooth scroll plugin.

    I have disabled it for this link and corrected the javascript error. I have also reverted to an empty hashtag.

    However it is still not working, it only jump to the top as it’s the normal behavior of the browser.

    Could you tell me a bit more about how the link is targeted? Is it linked to the classname?

    Thanks for your help!

    • This reply was modified 6 years, 4 months ago by Etienne.
    Plugin Author Nicola Modugno

    (@shark986)

    Ok @epipo, I have found the problem.

    The theme is echoing the footer after the “wp_print_footer_scripts” WordPress hook. The theme should print the footer with the “wp_footer” hook, which runs before the “wp_print_footer_scripts”, as you can see on codex (https://codex.www.ads-software.com/Plugin_API/Action_Reference).

    This cause the link to be inserted after the kit has attached the click event to links with the class “OpenCookiePreferences”.

    Thread Starter Etienne

    (@epipo)

    Yep, you’re a genius!! My bad I haven’t realized that…
    Thanks a lot for your help ??

    Plugin Author Nicola Modugno

    (@shark986)

    You are welcome! ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Cookie preference shortcode link not working’ is closed to new replies.