PHPackages                             zizther/craft-dynamic-variables - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. zizther/craft-dynamic-variables

ActiveCraft-plugin[Templating &amp; Views](/categories/templating)

zizther/craft-dynamic-variables
===============================

Allows you to parse any text as a Twig template, with access to variables, from globals, entries, etc.

2.0.1(2y ago)0470MITPHPPHP ^8.0

Since Jul 9Pushed 2y ago1 watchersCompare

[ Source](https://github.com/zizther/craft-dynamic-variables)[ Packagist](https://packagist.org/packages/zizther/craft-dynamic-variables)[ RSS](/packages/zizther-craft-dynamic-variables/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (9)Dependencies (2)Versions (14)Used By (0)

Craft Dynamic Variables plugin for Craft CMS 4.x &amp; 5.x
==========================================================

[](#craft-dynamic-variables-plugin-for-craft-cms-4x--5x)

Allows you to parse any text as a Twig template, with access to variables, from globals, entries, etc.

For Craft 3 support check out the [v1 branch](https://github.com/zizther/craft-dynamic-variables/tree/v1).

Requirements
------------

[](#requirements)

This plugin requires Craft CMS 4.0.0+ or 5.0.0+.

Installation
------------

[](#installation)

To install the plugin, follow these instructions.

1. Open your terminal and go to your Craft project:

    ```
     cd /path/to/project

    ```
2. Then tell Composer to load the plugin:

    ```
     composer require zizther/craft-dynamic-variables

    ```
3. In the Control Panel, go to Settings → Plugins and click the “Install” button for Dynamic Variables.

Dynamic Variables Overview
--------------------------

[](#dynamic-variables-overview)

The filter and function allows you to output variables from Craft, globals, plugins and your configs. You would reference the field as you would in a template with `{{ }}`.

This plugin is limited to outputting text based fields, by default, however if you would like to reference the entry itself you can do this passing in the entry within the filter or function, You will be able to reference any field within the entry you pass in.

```
{% set entry = craft.entries({ id: 1 }).one() %}
{{ '{{ entry.title }}' | dv(entry) }}
{{ dv('{{ entry.title }}', entry) }}

```

Using Dynamic Variables
-----------------------

[](#using-dynamic-variables)

Here are some example for using the filter and function.

### Craft

[](#craft)

Want to output the site name or site URL.

#### Filter

[](#filter)

`{{ '{{ siteName }} {{ siteUrl }}' | dv }}`

#### Function

[](#function)

`{{ dv('{{ siteName }} {{ siteUrl }}') }}`

### Globals

[](#globals)

If you want to output a global field, such as a telephone number.

#### Filter

[](#filter-1)

`{{ '{{ globalHandle.fieldHandle }}' | dv }}`

#### Function

[](#function-1)

`{{ dv('{{ globalHandle.fieldHandle }}') }}`

### Plugin example

[](#plugin-example)

If you want to output field data from a plugin such as SEOmatic.

#### Filter

[](#filter-2)

`{{ '{{ seomatic.site.sameAsLinks["instagram"]["url"] }}' | dv }}`

#### Function

[](#function-2)

`{{ dv('{{ seomatic.site.sameAsLinks["instagram"]["url"] }}') }}`

### Config example

[](#config-example)

Maybe you want to output a value from a config file, such as a custom value in the general.php file.

#### Filter

[](#filter-3)

`{{ '{{ craft.app.config.general.custom.variableName }}' | dv }}`

#### Function

[](#function-3)

`{{ dv('{{ craft.app.config.general.custom.variableName }}') }}`

Brought to you by [Nathan Reed](https://vimia.co.uk)

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~124 days

Recently: every ~324 days

Total

12

Last Release

821d ago

Major Versions

1.0.6 → 2.0.02022-05-11

v1.x-dev → 2.0.12024-04-02

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1436378?v=4)[Nathan Reed](/maintainers/zizther)[@zizther](https://github.com/zizther)

---

Top Contributors

[![zizther](https://avatars.githubusercontent.com/u/1436378?v=4)](https://github.com/zizther "zizther (26 commits)")

---

Tags

cmsCraftcraftcmscraft-plugindynamic variables

### Embed Badge

![Health badge](/badges/zizther-craft-dynamic-variables/health.svg)

```
[![Health](https://phpackages.com/badges/zizther-craft-dynamic-variables/health.svg)](https://phpackages.com/packages/zizther-craft-dynamic-variables)
```

###  Alternatives

[verbb/formie

The most user-friendly forms plugin for Craft.

102393.6k60](/packages/verbb-formie)[wbrowar/guide

A CMS Guide for Craft CMS.

6154.7k1](/packages/wbrowar-guide)[verbb/vizy

A flexible visual editor field for Craft.

4250.4k](/packages/verbb-vizy)[verbb/hyper

A user-friendly links field for Craft.

24147.8k12](/packages/verbb-hyper)[verbb/footnotes

Adds a footnotes feature to CKEditor fields and Twig templates.

213.6k](/packages/verbb-footnotes)[verbb/events

A full-featured plugin for event management and ticketing.

2311.9k](/packages/verbb-events)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
