- Convert MDX CodeBlock components to standard markdown code fences - Add rehype-mdx-code-props to pass filename meta to code components - Custom pre/code MDX components map fences to CodeBlock - Add brand color badges (product + category) matching /learn layout - Match prose styling: orange inline code, orange links, white strong - Remove brand color background glow (not in /learn)
48 lines
1.4 KiB
Plaintext
48 lines
1.4 KiB
Plaintext
---
|
|
title: "Drupal"
|
|
description: "Add Pulse analytics to your Drupal site using a module or theme template."
|
|
category: "cms"
|
|
brandColor: "#0678BE"
|
|
officialUrl: "https://www.drupal.org/docs"
|
|
relatedIds: ["wordpress", "joomla"]
|
|
date: "2026-03-28"
|
|
---
|
|
|
|
Add the Pulse script via a contributed module or by editing your theme's Twig template.
|
|
|
|
---
|
|
|
|
## Method 1: Using Asset Injector module
|
|
|
|
Install the [Asset Injector](https://www.drupal.org/project/asset_injector) module and create a new JS injector with the Pulse script. Set it to load on all pages in the header region.
|
|
|
|
## Method 2: Edit html.html.twig
|
|
|
|
Add the script directly to your theme's `html.html.twig` template in the head area.
|
|
|
|
```twig filename="templates/html.html.twig"
|
|
<!DOCTYPE html>
|
|
<html{{ html_attributes }}>
|
|
<head>
|
|
<head-placeholder token="{{ placeholder_token }}">
|
|
<title>{{ head_title|safe_join(' | ') }}</title>
|
|
<css-placeholder token="{{ placeholder_token }}">
|
|
<js-placeholder token="{{ placeholder_token }}">
|
|
|
|
<script
|
|
defer
|
|
data-domain="your-site.com"
|
|
src="https://pulse.ciphera.net/script.js"
|
|
></script>
|
|
</head>
|
|
<body{{ attributes }}>
|
|
{{ page_top }}
|
|
{{ page }}
|
|
{{ page_bottom }}
|
|
<js-bottom-placeholder token="{{ placeholder_token }}">
|
|
</body>
|
|
</html>
|
|
```
|
|
|
|
For more details, see the [Drupal theming docs](https://www.drupal.org/docs/theming-drupal).
|