Hallo,
wer in der 4.4.x eine cookiebar ohne Erweiterung einsetzen möchte (jquery muß im Theme aktiviert sein):
- Download Script von https://github.com/carlwoodhouse/jquery.cookieBar
- Hier wird nur das Script benötigt
- Eine Datei cookiebar.css mit folgendem Inhalt erstellen:
- Die beiden Dateien cookiebar.js und cookiebar.css in ein Theme Ordner kopierenCode:#cookiebar { box-sizing: border-box; position: fixed; left: 0; width: 100%; background-color: #4b4b4b; padding: 8px 16px; text-align: center; font-size: 13px; color: #ffffff; line-height: 2; z-index: 10; } #cookiebar.top { top: 0; } #cookiebar.bottom { bottom: 0; } #cookiebar-desc { display: inline-block; } #cookiebar span { margin-right: 1em; } #cookiebar .cookiebar-button, #cookiebar .cookiebar-info { margin-right: 8px; padding: 4px 8px; border: none; background-color: #fdfdfd; color: #666; cursor: pointer; display: inline-block; } #cookiebar a { color: #666; text-decoration: none; } #cookiebar a:hover { text-decoration: none; }
- Ein template mod_html_cookiebar.html5 mit folgendem Inhalt erstellen:
- Im Theme ein Modul "Eigener HTML-Code" erstellenCode:<?php $GLOBALS['TL_CSS'][] = 'PFAD ZUM ORDNER/cookiebar.css|static'; $GLOBALS['TL_JAVASCRIPT'][] = 'PFAD ZUM ORDNER/cookiebar.js|static'; ?> <?= $this->html ?> <script> jQuery(function($){ $(document).ready(function() { $('#cookiebar').cookieBar({ closeButton : '.cookiebar-button', hideOnClose: false }); $('#cookiebar').on('cookieBar-close', function() { $(this).slideUp(); }); }); }); </script>
- Unter "Individuelles Template" das obige Template auswählen/setzen
- Folgenden Inhalt setzen:
- Das Modul als letzten Eintrag im Seitenlayout eintragenCode:<div id="cookiebar" class="bottom" role="complementary" aria-describedby="cookiebar-desc"> <div id="cookiebar-desc" aria-live="assertive" role="alert"> <span> {{ifnlng::de}}This site uses cookies that will allow us to make your stay as pleasant as possible. If you continue the visit, you agree to this.{{ifnlng}} {{iflng::de}}Diese Seite verwendet Cookies, die es uns ermöglichen, Ihren Aufenthalt so angenehm wie möglich zu gestalten.Wenn Sie den Besuch fortsetzen, erklären Sie sich damit einverstanden.{{iflng}} </span> </div> <div class="cookiebar-button">OK</div><div class="cookiebar-info"><a href="http://LINK_EINTRAGEN" title="Details">Details</a></div> </div>

Zitieren
