Initial commit - Typo3 11.5.41
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
.. include:: ../Includes.rst.txt
|
||||
|
||||
.. _checkboxes_code:
|
||||
|
||||
===========
|
||||
Dynamic Checkboxes
|
||||
===========
|
||||
With this feature you can add or modify the checkbox types by configuration.
|
||||
All you have to do is setting your new checkbox in TS and add it to the partial template:
|
||||
|
||||
Configuration/TypoScript/setup.txt:
|
||||
|
||||
.. code-block:: typoscript
|
||||
|
||||
page.footerData.998.20.settings.checkboxes.thirdparty = {$plugin.tx_cookieconsent.settings.thirdparty}
|
||||
|
||||
Resources/Private/Partials/CookieSelection.html:
|
||||
|
||||
.. code-block:: html
|
||||
|
||||
<label for="dp--cookie-thirdparty">
|
||||
<f:form.checkbox id="dp--cookie-thirdparty" class="dp--check-box" checked="{settings.checkboxes.thirdparty}" value="" />
|
||||
<f:translate key="dpThirdparty" extensionName="dp_cookieconsent" />
|
||||
</label>
|
||||
|
||||
`F.A.Q. How to remove unneccesary checkboxes <https://github.com/DirkPersky/typo3-dp_cookieconsent/wiki/How-to-remove-unneccesary-checkboxes>`_
|
||||
@@ -0,0 +1,24 @@
|
||||
.. include:: ../Includes.rst.txt
|
||||
|
||||
.. _content_code:
|
||||
|
||||
===========
|
||||
load content after accepting
|
||||
===========
|
||||
**if you want to add contents that will only be visible if the consent hint is accepted**
|
||||
You can also handle this part from an :ref:`Content element <content>` if you want.
|
||||
|
||||
Your HTML markup for this is
|
||||
|
||||
.. code-block:: html
|
||||
|
||||
<dp-content
|
||||
data-cookieconsent="statistics"
|
||||
class="dp--iframe"
|
||||
|
||||
data-cookieconsent-notice="Cookie Notice"
|
||||
data-cookieconsent-description="Loading this...."
|
||||
data-cookieconsent-btn="allow cookies and load this ...."
|
||||
>
|
||||
YOUR CONTENT
|
||||
</dp-content>
|
||||
@@ -0,0 +1,45 @@
|
||||
.. include:: ../Includes.rst.txt
|
||||
|
||||
.. _iframe_code:
|
||||
|
||||
===========
|
||||
iframe loading from HTML
|
||||
===========
|
||||
You can also handle this part from an :ref:`Content element <content>` if you want.
|
||||
|
||||
load iframe after accepting
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
If you want to load iframes (YouTube, GMap, ..) after the Cookie is accepted you can use this snippet
|
||||
|
||||
.. code-block:: html
|
||||
|
||||
<iframe width="560" height="315"
|
||||
data-cookieconsent="statistics"
|
||||
data-src="https://www.youtube-nocookie.com/embed/XXXXXX?autoplay=1"
|
||||
class="dp--iframe"
|
||||
frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreenn >
|
||||
</iframe>
|
||||
|
||||
With the :guilabel:`class="dp--iframe"` the iframe is hidden by default and would be shown after accepting of the cookie.
|
||||
|
||||
iframe overlay
|
||||
^^^^^^^^^^^^^^
|
||||
**if you want to add an overlay to accept Cookies outside of the cookie hint**
|
||||
|
||||
.. figure:: ../Images/iframe-overlay.png
|
||||
:class: with-shadow
|
||||
:width: 400px
|
||||
|
||||
You also can modify the text in this hint individually per iframe
|
||||
|
||||
.. code-block:: html
|
||||
|
||||
<iframe
|
||||
data-cookieconsent="statistics"
|
||||
data-src="https://www.youtube-nocookie.com/embed/XXXXXX?autoplay=1"
|
||||
class="dp--iframe"
|
||||
|
||||
data-cookieconsent-notice="Cookie Notice"
|
||||
data-cookieconsent-description="Loading this...."
|
||||
data-cookieconsent-btn="allow cookies and load this ...."
|
||||
>
|
||||
@@ -0,0 +1,74 @@
|
||||
.. include:: ../Includes.rst.txt
|
||||
|
||||
.. _javascript-api:
|
||||
|
||||
=============================================================
|
||||
JavaScript API
|
||||
=============================================================
|
||||
|
||||
Events
|
||||
=======
|
||||
|
||||
dp--cookie-init
|
||||
^^^^^^^^^^^^^^^
|
||||
.. rst-class:: dl-parameters
|
||||
|
||||
dp--cookie-init
|
||||
:sep:`|`
|
||||
fire event when initialize process is done
|
||||
|
||||
dp--cookie-fire
|
||||
^^^^^^^^^^^^^^^
|
||||
.. rst-class:: dl-parameters
|
||||
|
||||
dp--cookie-fire
|
||||
:sep:`|` :aspect:`Event paremeter:` event.detail.$el
|
||||
:sep:`|`
|
||||
fire after a consent script/iframe is loaded
|
||||
|
||||
dp--cookie-accept
|
||||
^^^^^^^^^^^^^^^
|
||||
.. rst-class:: dl-parameters
|
||||
|
||||
dp--cookie-accept
|
||||
:sep:`|`
|
||||
fire when the consent is accepted
|
||||
|
||||
dp--cookie-accept-init
|
||||
^^^^^^^^^^^^^^^
|
||||
.. rst-class:: dl-parameters
|
||||
|
||||
dp--cookie-accept-init
|
||||
:sep:`|`
|
||||
fire accepted event on revisited
|
||||
|
||||
dp--cookie-deny
|
||||
^^^^^^^^^^^^^^^
|
||||
.. rst-class:: dl-parameters
|
||||
|
||||
dp--cookie-deny
|
||||
:sep:`|`
|
||||
fire when the consend is denied
|
||||
|
||||
dp--cookie-revoke
|
||||
^^^^^^^^^^^^^^^
|
||||
.. rst-class:: dl-parameters
|
||||
|
||||
dp--cookie-revoke
|
||||
:sep:`|`
|
||||
fire when the consent is revoked
|
||||
|
||||
.. code-block:: js
|
||||
|
||||
document.addEventListener('dp--cookie-fire', function (e) {
|
||||
console.log('dp--cookie-fire', e.detail.$el);
|
||||
});
|
||||
document.addEventListener('dp--cookie-accept', function (e) {
|
||||
console.log('dp--cookie-accept', e);
|
||||
});
|
||||
document.addEventListener('dp--cookie-deny', function (e) {
|
||||
console.log('dp--cookie-deny', e);
|
||||
});
|
||||
document.addEventListener('dp--cookie-revoke', function (e) {
|
||||
console.log('dp--cookie-deny', e);
|
||||
});
|
||||
@@ -0,0 +1,27 @@
|
||||
.. include:: ../Includes.rst.txt
|
||||
|
||||
.. _more_code:
|
||||
|
||||
===========
|
||||
build your own overlay
|
||||
===========
|
||||
or accept/deny cookies outside of the cookie hint, you can use the followed examples
|
||||
|
||||
.. code-block:: html
|
||||
|
||||
<button
|
||||
onclick="window.DPCookieConsent.forceAccept(this)"
|
||||
data-cookieconsent="statistics"
|
||||
>allow cookies and play video</button>
|
||||
|
||||
**allow cookies**
|
||||
|
||||
.. code-block:: js
|
||||
|
||||
window.DPCookieConsent.forceAccept(this)
|
||||
|
||||
**deny cookies**
|
||||
|
||||
.. code-block:: js
|
||||
|
||||
window.DPCookieConsent.forceDeny(this)
|
||||
@@ -0,0 +1,50 @@
|
||||
.. include:: ../Includes.rst.txt
|
||||
|
||||
.. _scripts_code:
|
||||
|
||||
===========
|
||||
Script loading from HTML
|
||||
===========
|
||||
|
||||
load scripts after accepting
|
||||
^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
**load script sources**
|
||||
If you want to load JavaScript resources after the Cookie is accepted you can use this snippet
|
||||
|
||||
.. code-block:: html
|
||||
|
||||
<script data-ignore="1" data-cookieconsent="statistics" type="text/plain" data-src="{YOUR_LINK_TO_JS}"></script>
|
||||
|
||||
**load inline script**
|
||||
If you want to load Inline JavaScript after the Cookie is accepted use this snippet.
|
||||
|
||||
.. code-block:: html
|
||||
|
||||
<script data-ignore="1" data-cookieconsent="statistics" type="text/plain">
|
||||
{YOUT_DYN_JS_CODE}
|
||||
</script>
|
||||
|
||||
The :guilabel:`data-ignore="1"` attribute is to cover the `Scriptmerger <https://extensions.typo3.org/extension/scriptmerger/>`_ engine to not combine these parts.
|
||||
|
||||
Checkbox mode
|
||||
^^^^^^^^^^^^
|
||||
Your customer can choose what types of scripts/cookies he wants to allow.
|
||||
These 2 types are possible and handled by the consent:
|
||||
|
||||
|
||||
statistics
|
||||
--------------------
|
||||
:aspect:`data-cookieconsent`
|
||||
statistics
|
||||
.. code-block:: html
|
||||
|
||||
<script data-cookieconsent="statistics" type="text/plain" data-ignore="1">
|
||||
|
||||
marketing
|
||||
--------------------
|
||||
:aspect:`data-cookieconsent`
|
||||
marketing
|
||||
.. code-block:: html
|
||||
|
||||
<script data-cookieconsent="marketing" type="text/plain" data-ignore="1">
|
||||
Reference in New Issue
Block a user