-
AuthorPosts
-
February 18, 2021 at 3:56 pm #1282012
Dear friends at the Enfold-support-team,
I would like to show only the cookie badge when the page loads for the first time, not the entire banner. The cookie-banner should only be displayed when you click on the badge. Is that possible? At the moment the banner is always loaded and only when a selection has been made it is replaced by the badge and the banner can be opened again. Can I change this behaviour?
Would be glad to get an answer. Thanks a lot!February 20, 2021 at 4:03 am #1282362Hey spooniverse,
I’m not sure I understand exactly what you mean, could you post a link to your site and try to explain your intentions a bit further please?
Best regards,
RikardFebruary 22, 2021 at 9:45 am #1282737Hey Rikard,
normally the banner is always shown on first pageload. If you then make a selection whether cookies are allowed or not, the banner disappears. After that you can see the badge on the side and use it to display the banner again. I would like to only see the badge right from the start and display the banner using the badge as a toggle. The banner should not appear when the page is loaded until the visitor decides what to do, it should only be displayed via the badge. There is a css class added after the cookie decision. Perhaps, for example, you could add this beforehand so that you don’t just see the banner, as I said, but only show it via the badge.
Can you understand it better like that? Thanks for your help!
All the best,
DanielFebruary 24, 2021 at 5:00 pm #1283454Hi,
Thank you for the inquiry.
We could use this css code to make the badge always visible.
#av-cookie-consent-badge { opacity: 0.7; visibility: visible; }
Then use this script to hide the message bar on initial load.
// a custom script function ava_custom_script_mod() { if ( wp_script_is( 'avia-default', 'registered' ) ) { wp_add_inline_script( 'avia-default', ' (function($) { $(document).ready(function() { $(".avia-cookie-consent").addClass("cookiebar-hidden"); }); })(jQuery); '); } } add_action( 'wp_enqueue_scripts', 'ava_custom_script_mod', 9999);
We have not tested this fully, so it might cause unintended privacy options behavior.
Best regards,
IsmaelFebruary 24, 2021 at 7:10 pm #1283505Perfect! Tested and tweaked it a little bit and it just works. Thank you.
Any chance to hide the badge while the banner is opened?
March 1, 2021 at 10:34 am #1284354Added some CSS. Works for me.
You can close this thread.
Thanks again!March 1, 2021 at 12:46 pm #1284391 -
AuthorPosts
- The topic ‘Cookie Badge’ is closed to new replies.