Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/tiny-dancers-lie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@qwik.dev/partytown': minor
---

feat: add new documentation for Drupal integration

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.
92 changes: 92 additions & 0 deletions docs/src/routes/drupal/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
---
title: Drupal
---

# Drupal

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.

## Install

### Using Composer

1. Use composer to download the Drupal module

``` bash
composer require drupal/partytown
```

2. Add the following code to your `composer.json` in the `repositories` section

``` json

partytown": {
"type": "package",
"package": {
"name": "quickdev/partytown",
"version": "0.11.0",
"type": "drupal-library",
"dist": {
"url": "https://registry.npmjs.org/@qwik.dev/partytown/-/partytown-0.11.0.tgz",
"type": "tar"
},
"license": "MIT"
}
}

```

3. Install the partytown JS library

``` bash
composer require quickdev/partytown
```

### Using The Composer Merge Plugin

1. Use composer to download the Drupal module

``` bash
composer require drupal/partytown
```

2. If not already installed, install Merge Plugin:

``` bash
composer require wikimedia/composer-merge-plugin
```

3. Merge the PartyTown library from the module's `composer.json`:

``` bash
composer config extra.merge-plugin.include --json '[ "web/modules/contrib/partytown/composer.libraries.json" ]'
```

### Manually

1. Download and unzip the Drupal module from the [PartyTown release page](https://www.drupal.org/project/partytown/releases)

2. Install the `partytown` directory in the Drupal `modules` directory (usually `<webroot>/modules` or `<webroot>/modules/contrib`)

3. Visit the Admin > Extend page of your Drupal installation and enable the PartyTown module

## Configure

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`.

## Managing Scripts With PartyTown

### Google Tag Manager

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`.

### Other scripts

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:

``` yaml
foo:
js:
js/foo.js: { attributes: { type: "text/partytown"} }

```
1 change: 1 addition & 0 deletions docs/src/routes/integrations/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Partytown can work with any HTML page, and doesn't require a specific framework.

- [Angular](/angular)
- [Astro](/astro)
- [Drupal](/drupal)
- [Gatsby](/gatsby)
- [HTML](/html)
- [NextJS](/nextjs)
Expand Down
1 change: 1 addition & 0 deletions docs/src/routes/menu.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

- [Angular](/angular)
- [Astro](/astro)
- [Drupal](/drupal)
- [Gatsby](/gatsby)
- [HTML](/html)
- [Magento 2](/magento2)
Expand Down
Loading