Skip to content

Commit

Permalink
Do not show the tracking code with empty or invalid settings
Browse files Browse the repository at this point in the history
The tracking code was displayed even if no idSite or host was configured
in the backend module (or manually in Settings.yaml).

This fixes this by adding two conditions that check if both host and
idSite parameters are set.
  • Loading branch information
TheLalaMan committed Dec 5, 2016
1 parent 4fca824 commit ee6a43e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
9 changes: 8 additions & 1 deletion Resources/Private/TypoScript/Prototypes/TrackingCode.ts2
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# A Piwik tracking code object
#
prototype(Portachtzig.Neos.Piwik:TrackingCode) < prototype(TYPO3.TypoScript:Template) {
@if.inLiveWorkspace = ${node.context.workspaceName == 'live'}
templatePath = 'resource://Portachtzig.Neos.Piwik/Private/Templates/Prototypes/TrackingCode.html'
settings = ${Configuration.setting('Portachtzig.Neos.Piwik')}

// Show tracking code only in live workspace and if all necessary parameters are set
@if {
inLiveWorkspace = ${node.context.workspaceName == 'live'}
hostIsSet = ${settings.host}
idSiteIsSet = ${settings.idSite}
}
}
6 changes: 1 addition & 5 deletions Resources/Private/TypoScript/Root.ts2
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,5 @@ prototype(TYPO3.Neos:Page) {
piwikTrackingCode = Portachtzig.Neos.Piwik:TrackingCode {
# Google suggests to include the tracking code directly after the <body> tag
@position = 'end'
settings = ${Configuration.setting('Portachtzig.Neos.Piwik')}

}
}


}

0 comments on commit ee6a43e

Please sign in to comment.