cluster Posted June 3, 2018 Share Posted June 3, 2018 I use WP for the main page and whmcs are installed in a subfolder as the order system ... this cookie bar plugin is installed in WPhttps://de.wordpress.org/plugins/cookie-law-info/ and I would like to integrate w/ WHMCS it uses WP jquery ... css and js are added into the whmcs header <script src="{$WEB_ROOT}/templates/{$template}/js/cookielawinfo.js"></script> <script src="{$WEB_ROOT}/templates/{$template}/css/cli-style.css"></script> if I now add this part in the footer, then breaks the footer (footer menu disappears) <div id="cookie-law-info-bar"><span>This website uses cookies to enable certain features of the site to operate. <a href="https://www.mydomain.tld/privacy-policy/" id="CONSTANT_OPEN_URL" class="cli-plugin-main-link" >Click here for more information</a> <a href="#" id="cookie_action_close_header" class="medium cli-plugin-button cli-plugin-main-button" >Accept</a></span></div> <script type="text/javascript"> //<![CDATA[ jQuery(document).ready(function() { cli_show_cookiebar({ settings: '{"animate_speed_hide":"500","animate_speed_show":"500","background":"#444444","border":"#ffffff","border_on":true,"button_1_button_colour":"#dd8808","button_1_button_hover":"#b16d06","button_1_link_colour":"#fff","button_1_as_button":true,"button_2_button_colour":"#333","button_2_button_hover":"#292929","button_2_link_colour":"#ffffff","button_2_as_button":false,"button_3_button_colour":"#000","button_3_button_hover":"#000000","button_3_link_colour":"#fff","button_3_as_button":true,"font_family":"inherit","header_fix":false,"notify_animate_hide":false,"notify_animate_show":false,"notify_div_id":"#cookie-law-info-bar","notify_position_horizontal":"right","notify_position_vertical":"bottom","scroll_close":false,"scroll_close_reload":false,"showagain_tab":false,"showagain_background":"#fff","showagain_border":"#000","showagain_div_id":"#cookie-law-info-again","showagain_x_position":"100px","text":"#ffffff","show_once_yn":false,"show_once":"10000"}' }); }); //]]> </script> could it be that I have to add jquery from WP also in WHMCS? 0 Quote Link to comment Share on other sites More sharing options...
cluster Posted June 3, 2018 Author Share Posted June 3, 2018 I guess the problem are the <![CDATA[ parts w/ smarty ... is there any chance to wrap the parts so it can work w/ WHMCS? <script type='text/javascript'> /* <![CDATA[ */ var Cli_Data = {"nn_cookie_ids":null}; /* ]]> */ </script> and <script type="text/javascript"> //<![CDATA[ jQuery(document).ready(function() { cli_show_cookiebar({ settings: '{"animate_speed_hide":"500","animate_speed_show":"500","background":"#444444","border":"#ffffff","border_on":true,"button_1_button_colour":"#dd8808","button_1_button_hover":"#b16d06","button_1_link_colour":"#fff","button_1_as_button":true,"button_2_button_colour":"#333","button_2_button_hover":"#292929","button_2_link_colour":"#ffffff","button_2_as_button":false,"button_3_button_colour":"#000","button_3_button_hover":"#000000","button_3_link_colour":"#fff","button_3_as_button":true,"font_family":"inherit","header_fix":false,"notify_animate_hide":false,"notify_animate_show":false,"notify_div_id":"#cookie-law-info-bar","notify_position_horizontal":"right","notify_position_vertical":"bottom","scroll_close":false,"scroll_close_reload":false,"showagain_tab":false,"showagain_background":"#fff","showagain_border":"#000","showagain_div_id":"#cookie-law-info-again","showagain_x_position":"100px","text":"#ffffff","show_once_yn":false,"show_once":"10000"}' }); }); //]]> </script> 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted June 3, 2018 Share Posted June 3, 2018 if you say it requires WP jQuery, that's the bit that would worry me trying to make this work with WHMCS.... i'd be more inclined to either make the existing WP Cookie bar cover everything on your site, or find a generic solution for WHMCS - they'll be plenty of free jQuery/php ones that should work. 0 Quote Link to comment Share on other sites More sharing options...
cluster Posted June 3, 2018 Author Share Posted June 3, 2018 (edited) hi Brian, it seems to be a problem with the brackets used for the parameters, it works w/o the parameter part like: <script type="text/javascript"> //<![CDATA[ jQuery(document).ready(function() { cli_show_cookiebar({ }); }); //]]> </script> I also tried to replace w/ parentheses but the function does not work after that "{" to "(" <script type="text/javascript"> //<![CDATA[ jQuery(document).ready(function() { cli_show_cookiebar({ settings: '("animate_speed_hide":"500","animate_speed_show":"500","background":"#444444","border":"#ffffff","border_on":true,"button_1_button_colour":"#dd8808","button_1_button_hover":"#b16d06","button_1_link_colour":"#fff","button_1_as_button":true,"button_2_button_colour":"#333","button_2_button_hover":"#292929","button_2_link_colour":"#ffffff","button_2_as_button":false,"button_3_button_colour":"#000","button_3_button_hover":"#000000","button_3_link_colour":"#fff","button_3_as_button":true,"font_family":"inherit","header_fix":false,"notify_animate_hide":false,"notify_animate_show":false,"notify_div_id":"#cookie-law-info-bar","notify_position_horizontal":"right","notify_position_vertical":"bottom","scroll_close":false,"scroll_close_reload":false,"showagain_tab":false,"showagain_background":"#fff","showagain_border":"#000","showagain_div_id":"#cookie-law-info-again","showagain_x_position":"100px","text":"#ffffff","show_once_yn":false,"show_once":"10000")' }); }); //]]> </script> I worked for 3 days w/ the WP bar integration because of above the fold problems with the scripts and design ... so now I would like to use this cookie bar in whmcs too ;-) Edited June 3, 2018 by cluster 0 Quote Link to comment Share on other sites More sharing options...
cluster Posted June 3, 2018 Author Share Posted June 3, 2018 now it works, just the css needs to be adjusted ... Curly braces {} are the default delimiters in Smarty. If you don't want curly braces interpreted as Smarty tags, you must enclose them in {literal}{/literal} tags. {literal} <script type="text/javascript"> //<![CDATA[ jQuery(document).ready(function() { cli_show_cookiebar({ settings: '{"animate_speed_hide":"500","animate_speed_show":"500","background":"#444444","border":"#ffffff","border_on":true,"button_1_button_colour":"#dd8808","button_1_button_hover":"#b16d06","button_1_link_colour":"#fff","button_1_as_button":true,"button_2_button_colour":"#333","button_2_button_hover":"#292929","button_2_link_colour":"#ffffff","button_2_as_button":false,"button_3_button_colour":"#000","button_3_button_hover":"#000000","button_3_link_colour":"#fff","button_3_as_button":true,"font_family":"inherit","header_fix":false,"notify_animate_hide":false,"notify_animate_show":false,"notify_div_id":"#cookie-law-info-bar","notify_position_horizontal":"right","notify_position_vertical":"bottom","scroll_close":false,"scroll_close_reload":false,"showagain_tab":false,"showagain_background":"#fff","showagain_border":"#000","showagain_div_id":"#cookie-law-info-again","showagain_x_position":"100px","text":"#ffffff","show_once_yn":false,"show_once":"10000"}' }); }); //]]> </script> {/literal} 0 Quote Link to comment Share on other sites More sharing options...
cluster Posted June 3, 2018 Author Share Posted June 3, 2018 Now I've been working for about 3 weeks on this EU cr*p ... such a waste of time ;-) 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted June 3, 2018 Share Posted June 3, 2018 out of interest, did you just add the code to the header/footer templates direct, or did you use header / footer hooks (which would probably be the simplest way to avoid update issues) ? 0 Quote Link to comment Share on other sites More sharing options...
cluster Posted June 3, 2018 Author Share Posted June 3, 2018 yes, also the css part is now placed into the footer.tpl ... this cookie bar is now the last part of the nightmare terrorism of the EU website regulations!!! 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.