You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12-19Lines changed: 12 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Datawrapper support for Silverstripe
2
2
3
-
This module provides an iframe element to embed [Datawrapper](https://datawrapper.de) charts and maps on a page, along with the script to enable responsiveness.
3
+
This module provides an iframe element to embed [Datawrapper](https://datawrapper.de) charts and maps on a page, as an Elemental content block, along with the script to enable responsiveness.
4
4
5
5
### Features
6
6
@@ -15,7 +15,7 @@ See [composer.json](./composer.json)
Further [documentation for content authors](./docs/en/001_index.md) is available.
30
29
31
30
## Configuration
32
31
33
-
### Webhooks
32
+
### Enable the element
34
33
35
-
```yaml
36
-
Name: 'app-datawrapper'
37
-
After:
38
-
- '#nswdpc-datawrapper'
39
-
NSWDPC\Datawrapper\WebhookController:
40
-
webhooks_enabled: true|false
41
-
webhooks_random_code: 'a random unguessable code'
42
-
```
34
+
Add the following to a project configuration,e.g. 'app/_config/datawrapper.yml` to enable the content block on Page records:
43
35
44
-
If you are using Datwrapper custom webhooks, add a `webhooks_random_code` value.
45
-
46
-
As there is no shared webhook signing key, anyone with the webhook URL and the Datawrapper Id of an element on your website will be able to publish elements.
47
-
You can change this random code at any time but you must ensure the custom webhook URL value at Datawrapper is updated to match.
You can use a system such as Pipedream to inspect and debug webhook requests.
@@ -33,12 +33,19 @@ You can use a system such as Pipedream to inspect and debug webhook requests.
33
33
34
34
Turn off|on via project configuration, the default is `true`
35
35
36
-
```yaml
37
-
NSWDPC\Datawrapper\Webhook:
38
-
webhooks_enabled: true|false
36
+
```yml
37
+
---
38
+
Name: app-datawrapper
39
+
After:
40
+
- '#nswdpc-datawrapper'
41
+
---
42
+
NSWDPC\Datawrapper\WebHookController:
43
+
webhooks_enabled: true
39
44
webhooks_random_code: 'some_random_code_string'
40
45
```
41
46
42
47
Use `webhooks_random_code` to randomise the URL. Using this example, the submission URL will look something like `https://mysite.example.com/_datawrapperwebhook/submit/some_random_code_string/`
43
48
44
49
This is empty by default. It's a good idea to have this value set as anyone who knows the URL and a Datawrapper chart ID you are using will be able to submit webhook requests.
50
+
51
+
To invalidate webhook requests, change the `webhooks_random_code` value and flush the configuration. Any webhooks configured at DataWrapper will need to be updated in this event.
0 commit comments