Skip to content

Commit

Permalink
Feature: Make JS in backend configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikdro committed Dec 22, 2020
1 parent 0874bb8 commit 4b573a1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Configuration/Settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,5 @@ KaufmannDigital:
# "rootNode name 2":
# siteCSSFilepath: <link to css>
# customCSSFilepath: <link to custom css>
backend:
includeGeneratedJs: true
5 changes: 4 additions & 1 deletion Resources/Private/Fusion/Root.fusion
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@ prototype(Neos.Neos:Page) {
var versionTimestamp = " + versionDate.timestamp * 1000 + ";
var dimensionsIdentifier = '" + (dimensionsIdentifier != '' ? dimensionsIdentifier : 'default') + "';
"}
@if.condition = ${node.context.inBackend == false}
@position = 'before closingBodyTag'
}

cookieConsentReopenJS = Neos.Fusion:Tag {
initializeJs = Neos.Fusion:Tag {
tagName = 'script'
content = ${File.readFile('resource://KaufmannDigital.GDPR.CookieConsent/Public/JavaScript/Initialize.js')}

@if.condition = ${node.context.inBackend == false}
@position = 'before closingBodyTag'
}

Expand All @@ -50,6 +52,7 @@ prototype(Neos.Neos:Page) {
arguments.dimensions = ${site.context.dimensions}
}

@if.condition = ${node.context.inBackend == false || Configuration.setting('KaufmannDigital.GDPR.CookieConsent.backend.includeGeneratedJs') == true}
@position = 'before closingBodyTag'
}
}
Expand Down

0 comments on commit 4b573a1

Please sign in to comment.