Skip to content

Commit fe4113d

Browse files
feat: add new documentation for Drupal integration (#701)
1 parent 2d7c9e6 commit fe4113d

4 files changed

Lines changed: 101 additions & 0 deletions

File tree

.changeset/tiny-dancers-lie.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@qwik.dev/partytown': minor
3+
---
4+
5+
feat: add new documentation for Drupal integration
6+
7+
This commit adds a new section to the integrations section of the documentation, detailing how to install, configure, and use the Drupal integration for PartyTown.

docs/src/routes/drupal/index.mdx

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
---
2+
title: Drupal
3+
---
4+
5+
# Drupal
6+
7+
The [Drupal](https://drupal.org) integration relies on a contributed module called ["PartyTown"](https://drupal.org/project/partytown), which can either be installed manually, or by using composer.
8+
9+
## Install
10+
11+
### Using Composer
12+
13+
1. Use composer to download the Drupal module
14+
15+
``` bash
16+
composer require drupal/partytown
17+
```
18+
19+
2. Add the following code to your `composer.json` in the `repositories` section
20+
21+
``` json
22+
23+
partytown": {
24+
"type": "package",
25+
"package": {
26+
"name": "quickdev/partytown",
27+
"version": "0.11.0",
28+
"type": "drupal-library",
29+
"dist": {
30+
"url": "https://registry.npmjs.org/@qwik.dev/partytown/-/partytown-0.11.0.tgz",
31+
"type": "tar"
32+
},
33+
"license": "MIT"
34+
}
35+
}
36+
37+
```
38+
39+
3. Install the partytown JS library
40+
41+
``` bash
42+
composer require quickdev/partytown
43+
```
44+
45+
### Using The Composer Merge Plugin
46+
47+
1. Use composer to download the Drupal module
48+
49+
``` bash
50+
composer require drupal/partytown
51+
```
52+
53+
2. If not already installed, install Merge Plugin:
54+
55+
``` bash
56+
composer require wikimedia/composer-merge-plugin
57+
```
58+
59+
3. Merge the PartyTown library from the module's `composer.json`:
60+
61+
``` bash
62+
composer config extra.merge-plugin.include --json '[ "web/modules/contrib/partytown/composer.libraries.json" ]'
63+
```
64+
65+
### Manually
66+
67+
1. Download and unzip the Drupal module from the [PartyTown release page](https://www.drupal.org/project/partytown/releases)
68+
69+
2. Install the `partytown` directory in the Drupal `modules` directory (usually `<webroot>/modules` or `<webroot>/modules/contrib`)
70+
71+
3. Visit the Admin > Extend page of your Drupal installation and enable the PartyTown module
72+
73+
## Configure
74+
75+
All configuration for the PartyTown module takes place in the Drupal admin interface. You can manage most of the PartyTown API settings graphically at `/admin/config/development/partytown`.
76+
77+
## Managing Scripts With PartyTown
78+
79+
### Google Tag Manager
80+
81+
The PartyTown module for Drupal comes with a submodule called "PartyTown Google Tag" for PartyTown-ing Google Tag Manager. Once installed, you will probably want to configure the PartyTown module to forward `dataLayer.push`.
82+
83+
### Other scripts
84+
85+
Other scripts can be PartyTown-ed by setting the type to be `text\partytown`. Using a `*.libraries.yml` this can be achieved with something similar to:
86+
87+
``` yaml
88+
foo:
89+
js:
90+
js/foo.js: { attributes: { type: "text/partytown"} }
91+
92+
```

docs/src/routes/integrations/index.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Partytown can work with any HTML page, and doesn't require a specific framework.
88

99
- [Angular](/angular)
1010
- [Astro](/astro)
11+
- [Drupal](/drupal)
1112
- [Gatsby](/gatsby)
1213
- [HTML](/html)
1314
- [NextJS](/nextjs)

docs/src/routes/menu.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
- [Angular](/angular)
2121
- [Astro](/astro)
22+
- [Drupal](/drupal)
2223
- [Gatsby](/gatsby)
2324
- [HTML](/html)
2425
- [Magento 2](/magento2)

0 commit comments

Comments
 (0)