Field Variables
Use dynamic variables like {entry_title}, {site_name}, {current_year}, and {pro:your_variable} inside supported channel fields. Field Variables replaces them with live values automatically on the front-end.
Requirements
| Requirement | Version |
|---|---|
| ExpressionEngine | 7.x |
| Pro Variables | Optional |
Installation
- Copy the
system/field_variablesfolder tosystem/user/addons/ - Copy the
themes/field_variablesfolder tothemes/user/third_party/ - In the Control Panel, go to Add-Ons
- Find Field Variables and click Install
After installation, go to Add-Ons → Field Variables to choose which channel fields should support variable replacement.
Uninstallation
Go to Add-Ons, find Field Variables, and click Uninstall. This removes the exp_field_variables_config database table and disables all variable replacement hooks.
What It Does
Field Variables lets editors store placeholder tokens inside selected fields instead of hard-coded text. When the field is rendered on the front-end, those tokens are replaced with live values from the current entry, the site config, the current date, or Pro Variables.
This is especially useful for reusable snippets such as CTA text, SEO copy, intro text, or rich text content that should stay synchronized across many entries.
Welcome to {site_name}
Read more about {entry_title}
Copyright {current_year}
Contact us at {pro:contact_email}
Configuration
Open Add-Ons → Field Variables in the Control Panel.
| Setting | Description |
|---|---|
| Enabled fields | Toggle supported channel fields on or off for variable replacement. |
| Field overview | Shows each field’s label, short name, type, and field group memberships. |
| Global variables | Lists all built-in variables available for insertion. |
| Pro Variables | Shows compatible Pro Variables that can be inserted as {pro:variable_name}. |
Only fields enabled in this screen will get the variable picker in the publish form and automatic token replacement on the front-end.
Supported Field Types
Field Variables only appears on field types that can safely contain text-based content.
| Field type | Supported |
|---|---|
text | Yes |
textarea | Yes |
rte | Yes |
wygwam | Yes |
redactor | Yes |
markitup | Yes |
medium_editor | Yes |
email_address | Yes |
url | Yes |
Non-text field types such as file fields, relationships, toggles, date fields, and selection-based inputs are intentionally excluded.
Available Tokens
Entry & global variables
| Token | Description |
|---|---|
{entry_title} | The current entry title. |
{site_name} | The current site name. |
{site_url} | The current site URL. |
{url_title} | The entry URL title / slug. |
{entry_url} | The full entry URL, based on the site URL and URL title. |
{entry_date} | The entry date, formatted using ExpressionEngine’s date format. |
{channel_name} | The channel title of the current entry. |
{author_name} | The screen name of the entry author. |
{current_year} | The current year. |
{current_date} | The current date, formatted using ExpressionEngine’s date format. |
Pro Variables
Any compatible Pro Variable can be inserted with the following format:
{pro:your_variable_name}
The variable name is the Pro Variable short name / handle. Text-like Pro Variables are available in the picker and in front-end replacement.
Publish Form
When a field has been enabled in the add-on settings, Field Variables injects an Insert Variable button into that field on the publish form.
Editors can click the button to insert any available built-in variable or Pro Variable directly into the field content, without having to remember the token syntax manually.
The raw token stays visible while editing, for example:
Welcome to {site_name}. Read our latest update: {entry_title}
Replacement happens when the content is rendered on the front-end, not while editing in the Control Panel.
Front-end Rendering
Field Variables resolves tokens in three places:
| Location | Behavior |
|---|---|
| Enabled channel fields | Tokens in enabled fields are replaced automatically inside channel output. |
| Channel entries tagdata | If template output contains matching field tags, their resolved values are injected into the final tagdata. |
| Final template output | Global tokens like {site_name}, {site_url}, {current_year}, {current_date}, and all {pro:*} variables are also replaced in final template output. |
Entry-specific tokens such as {entry_title} and {entry_url} require entry context. Global tokens and Pro Variables can also work outside channel entries.
Template Tags
Field Variables includes several module tags for outputting or resolving variables manually inside templates.
{exp:field_variables:var}
Outputs a built-in global variable by name.
{exp:field_variables:var name="site_name"}
Example output:
My Website
{exp:field_variables:pro}
Outputs a single Pro Variable by name.
{exp:field_variables:pro name="footer_text"}
{exp:field_variables:resolve}
Loads the content of a field from a specific entry and resolves any variables inside it.
{exp:field_variables:resolve entry_id="123" field="summary"}
Use this when you want to fetch a single field directly by entry ID and field short name.
{exp:field_variables:list}...{/exp:field_variables:list}
Loops over all built-in variables and lets you render your own reference list.
{exp:field_variables:list}
<li>{token} - {label}</li>
{/exp:field_variables:list}
Available placeholders inside the loop:
| Placeholder | Description |
|---|---|
{token} | The token itself, such as {site_name}. |
{label} | The human-readable label for that variable. |
{value} | The current resolved value. |
Database Table
Field Variables stores its configuration in a single table:
| Table | Purpose |
|---|---|
exp_field_variables_config | Stores which field IDs are enabled for each site. |
Changelog
1.0.0
- Initial public release
- Built-in support for dynamic field token replacement
- Control Panel variable picker for enabled fields
- Support for built-in variables and Pro Variables
- Module tags for manual variable output and field resolving