Skip to content

Commit

Permalink
TASK: updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Heinze committed May 3, 2023
1 parent 53503ff commit 3b3bf55
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 deletions.
5 changes: 3 additions & 2 deletions Configuration/Settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,12 @@ Sandstorm:
services: []
# NOTICE: This is not Klaro API. We added this feature to CookiePunch only.
contextualConsentOnly: false

##########################################################
# All tags specified like using the Eel Helper
# All tags specified using the Eel Helper
# e.g. `CookiePunch.blockTags(["iframe","script", "img"]`
# will be blocked on default. You can change the default blocking behaviour
# with this configuration.
# with the following configuration.
#
# Sandstorm:
# CookiePunch:
Expand Down
29 changes: 28 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ prototype(Neos.Neos:Page) {
```

This will add the needed js and css to your page. If you reload the page you should see the consent-modal. Now all `<iframe>` and `<script>` tags will be
blocked. Supported tags are `["iframe", "script", "audio", "video", "source", "track", "img", "embed", "input"]`
blocked. Supported tags are `["iframe", "script", "audio", "video", "source", "track", "img", "embed", "input"]`

`!node.context.inBackend` disables blocking in the Neos backend.

Expand Down Expand Up @@ -267,6 +267,33 @@ Most of the inline comments are directly copied from the [annotated config.js](h

Most of the inline comments are directly copied from the [annotated config.js](https://github.com/kiprotect/klaro/blob/ec6e36934db10afdac0183721ddfbcb9c79e7dc3/dist/config.js) of klaro for your convenience ;)

### Changing the default blocking behaviour

```neosfusion
prototype(Neos.Neos:Page) {
head.javascripts.cookiepunchConsent = Sandstorm.CookiePunch:Consent
# Block Global
@process.blockTags = ${CookiePunch.blockTags(["iframe","script", "img"], value, !node.context.inBackend)}
}
```

`CookiePunch.blockTags(["iframe","script", "img"]` tells CookiePunch which tags to look for.
All `<iframe>`, `<script>` and `<img>` tags will be blocked on default. However for images you
probably do not want to block all tags but decide which pattern to block. For this you can change
the default blocking behaviour using `"*": false` pattern for the `img` tag.

```
Sandstorm:
CookiePunch:
blocking:
tagPatterns:
img:
"*":
block: false
"tracking-pixel-url":
service: myservice
```

### Blocking a rendered fusion subtree

An already blocked markup will not be blocked again when running the eel-helpers for `Neos.Neos:Page`.
Expand Down

0 comments on commit 3b3bf55

Please sign in to comment.