Jump to content

include cookie bar


Recommended Posts

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 WP
https://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?

Link to comment
Share on other sites

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>

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 by cluster
Link to comment
Share on other sites

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}

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated