I am using the Games News template for a new site design, but I decided I did not want to use the standard Cookie law plugin (enabled in the template configuration settings). Instead I wanted to emulate the cookie banner that you use on your own site (the red banner with the following message.."GavickPro website uses cookies. By continuing to use this website, you are giving consent to cookies being used. For more information visit our Cookie policy.".
Taking a lead from a forum post via the Word press section https://www.gavick.com/forums/simplicit ... nt#p119030
I was able to add the following CSS code to my Override.css file...
- Code: Select all
/* Cookie Law */
#gk-cookie-law { background: #E55E48; bottom: 0; color: #fff; font: 400 16px/52px 'Open Sans',sans-serif; height: 52px; left: 0; margin: 0!important; position: fixed; text-align: center; width: 100%; z-index: 10001; }
#gk-cookie-law span { display: inline-block; max-width: 90%; }
#gk-cookie-law a { color: #fff; font-weight: 600; text-decoration: underline}
#gk-cookie-law a:hover { color: #222}
#gk-cookie-law a.gk-cookie-law-close { background: #c33c26; color: #fff; display: block; float: right; font-size: 28px; font-weight: bold; height: 52px; line-height: 52px; width: 52px;text-decoration: none}
#gk-cookie-law a.gk-cookie-law-close:active,
#gk-cookie-law a.gk-cookie-law-close:focus,
#gk-cookie-law a.gk-cookie-law-close:hover { background: #282828; }
@media (max-width: 1280px) { #gk-cookie-law { font-size: 13px!important; } }
@media (max-width: 1050px) { #gk-cookie-law { font-size: 12px!important; line-height: 26px!important; } }
@media (max-width: 620px) { #gk-cookie-law { font-size: 11px!important; line-height: 18px!important; } #gk-cookie-law span { max-width: 80%; } }
@media (max-width: 400px) { #gk-cookie-law { font-size: 10px!important; line-height: 13px!important; } }
And the HTML code I added to the default.php file (templates/gk_gamenews/layouts/) - and placed this under the header option.
- Code: Select all
<head>
<p id="gk-cookie-law"><span>Crowdedbrain's website uses cookies. By continuing to use this website, you are giving consent to cookies being used. For more information visit our <a href="/uncategorised/cookies.html">Cookie policy.</a></span> <a href="#close" class="gk-cookie-law-close">×</a></p>
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
<?php if($this->API->get('rwd', 1)) : ?>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2.0">
<?php else : ?>
<meta name="viewport" content="width=<?php echo $this->API->get('template_width', 1020)+80 ?>">
<?php endif; ?>
<jdoc:include type="head" />
<?php $this->layout->loadBlock('head'); ?>
<?php $this->layout->loadBlock('cookielaw'); ?>
</head>
The banner displays fine and the link to the cookie policy page likewise. However the problem is the close button. When I click on the close button it does nothing (where as on your site it closes the page and the banner disappears). I've tried to change the button url from #close to point to a physical link on my site and while this works the banner keeps popping up.
I'm assuming this is because the cookie is not being set.
So my question is what I am missing? With the Game News template is there any other piece of code I need to add to the above code so that when the close button is pressed it will save a cookie and remove the banner?
Thanks for your time..
Brett