Skip to content

Commit

Permalink
[BUGFIX] Fix wrong documentation of dataServiceProcessor (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
susannemoog committed Sep 18, 2020
1 parent e82da95 commit c86f520
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
20 changes: 10 additions & 10 deletions Documentation/Usage/Index.rst
Expand Up @@ -25,7 +25,7 @@ configured in :typoscript:`plugin.tx_usercentrics.jsInline`.

The following arguments are accepted:

* :typoscript:`dataProcessingService` (string) **mandatory** - the data processing service name as configured in Usercentrics
* :typoscript:`dataServiceProcessor` (string) **mandatory** - the data processing service name as configured in Usercentrics
* :typoscript:`file` (string) **mandatory for external files** - the path to the script file
* :typoscript:`value` (string) **mandatory for inline scripts** - the JavaScript being rendered inline
* :typoscript:`attributes` (array) - a key / value dictionary with attributes to be rendered in the :html:`<script>` tag
Expand All @@ -38,7 +38,7 @@ Example:
plugin.tx_usercentrics {
jsFiles {
10 {
dataProcessingService = Google Analytics
dataServiceProcessor = Google Analytics
file = https://www.google-analytics.com/analytics.js
attributes {
async = async
Expand All @@ -48,7 +48,7 @@ Example:
jsInline {
10 {
dataProcessingService = Google Analytics
dataServiceProcessor = Google Analytics
value (
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
ga('create', 'UA-XXXXX-Y', 'auto');
Expand All @@ -73,7 +73,7 @@ namespace may need to be imported.
The following arguments are accepted:
* :typoscript:`src` (string) **mandatory for external files** - the path to the script file
* :typoscript:`dataProcessingService` (string) **mandatory** - the data processing service name as configured in Usercentrics
* :typoscript:`dataServiceProcessor` (string) **mandatory** - the data processing service name as configured in Usercentrics
* :typoscript:`attributes` (array) - a key / value dictionary with attributes to be rendered in the :html:`<script>` tag
* :typoscript:`priority` (bool) - defines whether an include is rendered in :html:`<head>` or at the bottom of :html:`<body>`
Expand All @@ -84,8 +84,8 @@ Example:
.. code-block:: html
<html xmlns:usercentrics="http://typo3.org/ns/T3G/AgencyPack/Usercentrics/ViewHelpers">
<usercentrics:script dataProcessingService="Google Analytics" src="https://www.google-analytics.com/analytics.js" />
<usercentrics:script dataProcessingService="Google Analytics">
<usercentrics:script dataServiceProcessor="Google Analytics" src="https://www.google-analytics.com/analytics.js" />
<usercentrics:script dataServiceProcessor="Google Analytics">
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
ga('create', 'UA-XXXXX-Y', 'auto');
ga('send', 'pageview');
Expand All @@ -102,18 +102,18 @@ Example:
.. code-block:: php
$dataProcessingService = 'Google Analytics';
$dataServiceProcessor = 'Google Analytics';
$assetCollector = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Page\AssetCollector::class);
$identifier = \TYPO3\CMS\Core\Utility\StringUtility::getUniqueId($dataProcessingService . '-');
$identifier = \TYPO3\CMS\Core\Utility\StringUtility::getUniqueId($dataServiceProcessor . '-');
$file = 'https://www.google-analytics.com/analytics.js';
$attributes = [
'type' => 'text/plain',
'data-usercentrics' => $dataProcessingService
'data-usercentrics' => $dataServiceProcessor
];
$assetCollector->addJavaScript($identifier, $file, $attributes);
$identifier = \TYPO3\CMS\Core\Utility\StringUtility::getUniqueId($dataProcessingService . '-');
$identifier = \TYPO3\CMS\Core\Utility\StringUtility::getUniqueId($dataServiceProcessor . '-');
$source = 'window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;'
. 'ga(\'create\', \'UA-XXXXX-Y\', \'auto\');'
. 'ga(\'send\', \'pageview\');';
Expand Down
16 changes: 8 additions & 8 deletions README.md
Expand Up @@ -26,10 +26,10 @@ plugin.tx_usercentrics {
10.file = EXT:site/Resources/Public/JavaScriyt/MyScriptFile.js
# Identifier to use in Usercentrics (required)
10.dataProcessingService = My Data Processing Service
10.dataServiceProcessor = My Data Processing Service
20.file = secondFile.js
20.dataProcessingService = My other Data Processing Service
20.dataServiceProcessor = My other Data Processing Service
# attributes for the script tag (optional)
20.attributes {
Expand All @@ -47,7 +47,7 @@ plugin.tx_usercentrics {
10.value (
alert(123);
)
10.dataProcessingService = My Data Processing Service
10.dataServiceProcessor = My Data Processing Service
10.attributes {
custom = attribute
}
Expand All @@ -64,8 +64,8 @@ You do not need to set the `type` or `data-usercentrics` attributes for the scri
The extension comes with a custom view helper which can be used to add scripts via Fluid:

```html
<usercentrics:script dataProcessingService="identifier123" src="EXT:my_ext/Resources/Public/JavaScript/foo.js" />
<usercentrics:script dataProcessingService="identifier123">
<usercentrics:script dataServiceProcessor="identifier123" src="EXT:my_ext/Resources/Public/JavaScript/foo.js" />
<usercentrics:script dataServiceProcessor="identifier123">
alert('hello world');
</usercentrics:script>
```
Expand All @@ -78,12 +78,12 @@ set the attributes `type=text/plain` and `data-usercentrics=identifer`.
Example:

```
$dataProcessingService = 'My Data Processing Service';
$identifier = \TYPO3\CMS\Core\Utility\StringUtility::getUniqueId($dataProcessingService . '-');
$dataServiceProcessor = 'My Data Processing Service';
$identifier = \TYPO3\CMS\Core\Utility\StringUtility::getUniqueId($dataServiceProcessor . '-');
$file = 'EXT:site/Resources/Public/JavaScript/Scripts.js';
$attributes = [
'type' => 'text/plain',
'data-usercentrics' => $dataProcessingService
'data-usercentrics' => $dataServiceProcessor
];
$assetCollector = GeneralUtility::makeInstance(AssetCollector::class);
$assetCollector->addJavaScript($identifier, $file, $attributes);
Expand Down

0 comments on commit c86f520

Please sign in to comment.