Adding code to a website

All Quick 'n Easy Web Builder support issues that are not covered in the forums below.
Post Reply
ekdesigns
Posts: 13
Joined: Sat Apr 07, 2018 4:44 pm

Adding code to a website

Post by ekdesigns »

Hiya,

I found a nice bit of code for a cookie consent (I know there is one for this software but I wasn't sure how customised I could get it to match a website I'm recreating) - but the instructions are to place it before the </head> tag - I've tried a few of the options on 'insert html' and nothing seems to be appearing. I tested it out on another software and it appears fine so I must be doing something wrong.. Or perhaps it wouldn't be supported?

Here's the code:
<link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.0.3/cookieconsent.min.css" />
<script src="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.0.3/cookieconsent.min.js"></script>
<script>
window.addEventListener("load", function(){
window.cookieconsent.initialise({
"palette": {
"popup": {
"background": "#232323"
},
"button": {
"background": "#f4cc22"
}
},
"content": {
"message": "We use cookies to track usage and preferences.",
"dismiss": "I Understand",
"link": "Privacy Policy",
"href": "http://www.malcolmdown.co.uk/privacypolicy.html"
}
})});
</script>

Many thanks!
Esther
User avatar
Pablo
Site Admin
Posts: 3918
Joined: Mon Feb 13, 2006 7:00 am
Location: Europe
Contact:

Re: Adding code to a website

Post by Pablo »

You can place this code between the head tags in Page HTML.
The code will be inserted "AS IS", so it will work the same as with other software.

Note that because the 'https' prefix is missing in the css/script references, this code will only work online.
ekdesigns
Posts: 13
Joined: Sat Apr 07, 2018 4:44 pm

Re: Adding code to a website

Post by ekdesigns »

Hi Pablo,

Yes I thought as much, but unfortunately even after I put the code in that location and also publish it, it's still not appearing. I did get it to work briefly when I discovered another version of the code was also in the 'inside <html> tag' part but when I got rid of that, it never appeared again! Must be missing something..

Here's where I published it: http://www.ekdesigns.co.uk/demo/

Thanks,
Esther
User avatar
Pablo
Site Admin
Posts: 3918
Joined: Mon Feb 13, 2006 7:00 am
Location: Europe
Contact:

Re: Adding code to a website

Post by Pablo »

It seems to work correct for me.
Maybe you have clicked 'I Understand' and it will never be displayed again?
mexman
Posts: 547
Joined: Mon Feb 11, 2013 11:33 am
Location: Puebla/Mexico

Re: Adding code to a website

Post by mexman »

Esther:
It is not working here, because you inserted PHP code into teh demo page without changing its extension to "PHP"
Regards
Michael
QnEWB V6.x - Ubuntu 18.04
Post Reply