Skip to content

Commit

Permalink
Merge pull request #50 from KaufmannDigital/bugfix/fix-document-rende…
Browse files Browse the repository at this point in the history
…ring

BUGFIX: modify backend javascript to not redirect to start page
  • Loading branch information
Nikdro authored Mar 13, 2023
2 parents 8c8f3bd + 731806c commit ad34772
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Resources/Private/Fusion/Document/CookieSettingsPage.fusion
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
prototype(KaufmannDigital.GDPR.CookieConsent:Document.CookieSettingsPage) < prototype(Neos.Fusion:Component) {

@context.cookieSettingsPage = ${node}

@context.cookieSettings = KaufmannDigital.GDPR.CookieConsent:Content.CookieSettings {
@context.node = ${q(site).find('[instanceof KaufmannDigital.GDPR.CookieConsent:Document.CookieSettingsPage]').find('[instanceof KaufmannDigital.GDPR.CookieConsent:Content.CookieSettings]').get(0)}
}
Expand All @@ -10,6 +12,11 @@ prototype(KaufmannDigital.GDPR.CookieConsent:Document.CookieSettingsPage) < prot
@context.node = ${site}
@context.documentNode = ${site}

element.head.javascriptBackendInformation {
# for backend purposes we still consider the cookiesettingspage to be the documentNode
@context.documentNode = ${cookieSettingsPage}
}

@process.addCookieSettings = ${String.pregReplace(value, '/(.*)<\/body>(.*)/s', '$1' + cookieSettings + "</body>$2")}
}

Expand Down

0 comments on commit ad34772

Please sign in to comment.