# Before Compile Head

<!-- meta: type=event-onBeforeCompileHead; location=Joomla Events › After Events; category=Trigger; platforms=Joomla -->

## Overview

When it runs: During page generation, before Joomla assembles the HTML head (meta tags, title, and registered styles/scripts).

Plugins can add or alter head assets before they are compiled into the final head section.

Each run also includes who was logged in at the time and what kind of item was involved — see audit_user and audit_type in Payload Fields below.

This trigger is active when Platform Events are turned on in Joomla (System → JOrchestrator) and matching flows are set to Active.

When this trigger fires, JOrchestrator starts the flow and passes the incoming event or request data to the next connected step. Configure filtering, payload shape, and security on the **Design** tab.

## Why use this node

Before Compile Head is a **trigger** in the **Joomla Events › After Events** group. Triggers start a flow. They listen for an external signal — a CMS event, inbound HTTP call, payment notification, or schedule — and pass the incoming data to the first downstream step.

Typical reasons teams add **Before Compile Head** to a flow:

- Automate backend work when Joomla fires `BeforeCompileHead`
- Notify administrators or sync external systems on this CMS lifecycle event
- Enrich or validate CMS data before it is persisted
- Audit user, content, or extension activity without custom plugins

## When it runs

During page generation, before Joomla assembles the HTML head (meta tags, title, and registered styles/scripts).

## Example workflows

Common patterns on the canvas:

1. **Before Compile Head** → **Send Notification** (admin alert)
2. **Before Compile Head** → **Insert Row** (audit log)
3. **Before Compile Head** → **If** → **Send Email** / **Update Article**

## Properties panel

The designer shows these tabs for this node:

| Tab | Purpose |
|-----|---------|
| **Info** | Plain-language description and output payload fields for downstream steps |
| **Design** | Trigger configuration and payload schema |

### System (automatic — not edited by the user)

These fields are managed by the designer or runtime — you do not type into them directly:

| Property key | Label | Type | Required | Visible when | Notes |
|--------------|-------|------|----------|--------------|-------|
| `_nodeId` | Node ID | `node-id` | No | — | — |

### User-configured — General tab

| Property key | Label | Type | Required | Visible when | Notes |
|--------------|-------|------|----------|--------------|-------|
| `label` | Label | `text` | No | — | Node label |

### CMS site configuration (not on this node's properties panel)

Credentials, API keys, mailers, SMTP, and integration defaults are configured in the CMS plugin under **Node Configuration**, not per step on this node. Link the flow to a domain before testing CMS-backed fields.

## Output payload fields

After this step runs, later nodes can reference these fields using placeholders such as
`{{before_compile_head.application.name}}`.

| Field key | Type | Description |
|-----------|------|-------------|
| `application.name` | string | Nested field "application.name" from this node's output payload. |
| `application.client` | number | Nested field "application.client" from this node's output payload. |
| `input.option` | string | Nested field "input.option" from this node's output payload. |
| `input.view` | string | Nested field "input.view" from this node's output payload. |
| `input.task` | string | Nested field "input.task" from this node's output payload. |
| `input.layout` | string | Nested field "input.layout" from this node's output payload. |
| `input.id` | string | Nested field "input.id" from this node's output payload. |
| `input.Itemid` | string | Nested field "input.Itemid" from this node's output payload. |
| `config.sitename` | string | Nested field "config.sitename" from this node's output payload. |
| `config.fromname` | string | Nested field "config.fromname" from this node's output payload. |
| `config.mailfrom` | string | Nested field "config.mailfrom" from this node's output payload. |
| `config.live_site` | string | Nested field "config.live_site" from this node's output payload. |
| `document.title` | string | Nested field "document.title" from this node's output payload. |
| `document.description` | string | Nested field "document.description" from this node's output payload. |
| `document.language` | string | Nested field "document.language" from this node's output payload. |
| `document.charset` | string | Nested field "document.charset" from this node's output payload. |
| `document.metaTags.standard.description` | string | Nested field "document.metaTags.standard.description" from this node's output payload. |
| `document.metaTags.standard.keywords` | string | Nested field "document.metaTags.standard.keywords" from this node's output payload. |
| `audit_user.id` | number | Nested field "audit_user.id" from this node's output payload. |
| `audit_user.username` | string | Nested field "audit_user.username" from this node's output payload. |
| `audit_user.email` | string | Nested field "audit_user.email" from this node's output payload. |
| `audit_user.name` | string | Nested field "audit_user.name" from this node's output payload. |
| `audit_user.guest` | boolean | Nested field "audit_user.guest" from this node's output payload. |
| `audit_user.client` | string | Nested field "audit_user.client" from this node's output payload. |
| `audit_type` | string | What kind of item triggered the event — for example article, category, or user. |

## Related nodes

Other steps in the same area of the palette:

- **After Compile Head** (`event-onAfterCompileHead`) — Joomla Events › After Events
- **After Dispatch** (`event-onAfterDispatch`) — Joomla Events › After Events
- **After Initialise** (`event-onAfterInitialise`) — Joomla Events › After Events
- **After Render** (`event-onAfterRender`) — Joomla Events › After Events
- **After Route** (`event-onAfterRoute`) — Joomla Events › After Events
