-
AuthorPosts
-
November 7, 2022 at 6:19 am #1371596November 7, 2022 at 7:35 am #1371609
Hi Guenter!
Thank you for the inquiry.
Would you like the site to reload every time the user click any of the privacy toggles? The page will only reload once the user click the “accept” or “do not accept” buttons as explained in the previous thread.
// https://kriesi.at/support/topic/cookie-switch-buttons/#post-1369509
Regards,
IsmaelNovember 7, 2022 at 8:35 pm #1371695November 9, 2022 at 7:15 am #1371860Hi,
How did you insert the privacy-container element in the video? If you want to move the video privacy toggle inside, you can directly add the html of the toggle or use the privacy shortcode. Now, to reload the page after accepting the video privacy shortcode, you can try this script.
// reload the page after clicking the privacy toggles function ava_custom_script_privacy_toggle_reload() { ?> <script type="text/javascript"> (function($) { $('.av-switch-aviaPrivacyVideoEmbedsDisabled').on('click', function() { var input = $(this).find('#aviaPrivacyVideoEmbedsDisabled'); if(input.is(':checked')) location.reload( true ); }); })(jQuery); </script> <?php } add_action( 'wp_footer', 'ava_custom_script_privacy_toggle_reload', 9999 );
This is the html of the video privacy toggle.
<div class="av-switch-aviaPrivacyVideoEmbedsDisabled av-toggle-switch av-cookie-disable-external-toggle av-cookie-save-unchecked av-cookie-default-unchecked active"><label><input type="checkbox" id="aviaPrivacyVideoEmbedsDisabled" class="aviaPrivacyVideoEmbedsDisabled " name="aviaPrivacyVideoEmbedsDisabled"><span class="toggle-track"></span><span class="toggle-label-content">Hier klicken, um Videoeinbettungen zu aktivieren/deaktivieren.</span></label></div>
Best regards,
IsmaelNovember 9, 2022 at 10:37 am #1371875thanks – i will test it soon.
November 10, 2022 at 9:22 am #1372025November 10, 2022 at 11:33 am #1372047have a look at test page – your hint to reload it by an if clause was exactly what i need – i tested a different method
see private content – and see also how it works now – best would be to have that switch now inside that privacy overlay.
to be continued …November 11, 2022 at 9:12 am #1372170Hi,
Thank you for the update.
Looks like the page only reloads when the toggle is clicked twice. Maybe because of the condition that we added in the script. The following line may require some adjustment like removing the condition for the input value altogether.
if(input.is(':checked')) location.reload( true );
Best regards,
IsmaelNovember 13, 2022 at 1:15 am #1372382I can’t get it to work.
I am looking for a solution that the page is reloaded on rejection and the checkbox remains unchecked.The switch on #av-consent-extra-info behaves this way. But a sitch placed inside content not. -
AuthorPosts
- You must be logged in to reply to this topic.