PHPackages                             terminal42/contao-inserttags - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. terminal42/contao-inserttags

ActiveContao-bundle[Utility &amp; Helpers](/categories/utility)

terminal42/contao-inserttags
============================

Contao extension to create custom insert tags.

2.5.0(2mo ago)1048.5k↓31.1%7MITPHPPHP ^8.1CI passing

Since Jan 18Pushed 1mo ago4 watchersCompare

[ Source](https://github.com/terminal42/contao-inserttags)[ Packagist](https://packagist.org/packages/terminal42/contao-inserttags)[ GitHub Sponsors](https://github.com/terminal42)[ Fund](https://ko-fi.com/terminal42)[ RSS](/packages/terminal42-contao-inserttags/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (7)Dependencies (13)Versions (25)Used By (0)

terminal42/contao-inserttags
============================

[](#terminal42contao-inserttags)

Adds a back end module to define your custom insert tags. You can limit an insert tag to certain pages, show it to guests only, or restrict it to certain logged in front end member groups.

For more complex use cases, the extension also supports [Contao's Simple Token syntax](https://docs.contao.org/dev/reference/services/#simpletokenparser), which allows for more powerful and dynamic replacements.

Example token
-------------

[](#example-token)

- Insert tag: `phone`
- Replacement: `+48 123 456 789`
- Usage: `{{custom::phone}}`
- Output: `+48 123 456 789`

Supported Simple Tokens
-----------------------

[](#supported-simple-tokens)

The Simple Tokens are split into two types:

### Evaluation tokens

[](#evaluation-tokens)

The evaluation tokens are meant to be used in the conditional statements and have a format of `token.property`.

Here is a list of supported evaluation tokens:

1. `member.*` – current member properties, if logged in. Caution, it can be `null` if no member is logged in!
2. `page.*` – current page properties.

Examples:

```
{if member and 456 in member.groups}
This content is visible explicitly to the members of group ID 456.
{endif}

{if page and 123 in page.trail}
I am a subpage of page ID 123!
{endif}

{if page and page_language in ["de_DE", "pl_PL"]}
German and Polish
{else}
All other languages
{endif}

{if page and page_language matches "^de"}
German
{else}
Not German
{endif}

```

Note: Always check for `page` and `member` before doing comparisons. If you are in the Contao back end, none of them are set.

### Replacement tokens

[](#replacement-tokens)

The replacement tokens are meant to be used to output the data and have a format of `##token_property##`.

Here is a list of supported replacement tokens:

1. `##member_*##` – current member properties, if logged in.
2. `##page_*##` – current page properties.

Examples:

```
{if member}
Hello ##member_firstname## ##member_lastname##!
{else}
Hello anonymous!
{endif}

You current page language is: ##page_language##

```

### Comments

[](#comments)

From version 2.1.0 you can use comments to describe the replacements:

```
# Show content only to the logged in users
{if member}
Hello ##member_firstname## ##member_lastname##!
{endif}

```

If you would like to use a hash as the first character of the line, you can escape it as follows: `\#`.

Security concerns
-----------------

[](#security-concerns)

**Q: Why there are two types of token?**

A: The evaluation tokens refer to the real objects. However, the objects should NEVER be used as replacement tokens due to security reasons. For that, we introduced the replacement tokens which contain the plain string data.

**Q: Why there is no support for the `request`?**

A: The request may contain malicious data that is provided e.g., as a query parameter, and it could be dangerous to allow users to display it in the frontend.

**Q: Why there is no support for tag parameters like `{{custom::my_tag::my_param_1::my_param_2}}`?**

A: The tag parameters cannot be validated which is potentially dangerous.

Upgrade from version 1.x
------------------------

[](#upgrade-from-version-1x)

Some options present in version 1.x have been removed. All changes are described below.

### Removed "timing"

[](#removed-timing)

The timing feature has been removed completely, because it would kill HTTP caching. If you need a replacement, please consider a JavaScript solution.

### Removed "limitLanguages"

[](#removed-limitlanguages)

This option has been removed completely, use the limiting insert tags to certain pages feature instead.

### Removed "useCondition"

[](#removed-usecondition)

This option has been removed completely as this too, would make HTTP caching impossible.

### Removed "useCounter"

[](#removed-usecounter)

This option has been removed completely as this too, would make HTTP caching impossible.

### Removed "mode"

[](#removed-mode)

This option has been removed completely, as insert tags are only present in the front end.

### Removed "cacheOutput"

[](#removed-cacheoutput)

This option has been removed completely as it is not required in version 2 anymore.

License
-------

[](#license)

This bundle is released under the [MIT license](LICENSE)

###  Health Score

61

—

FairBetter than 99% of packages

Maintenance87

Actively maintained with recent releases

Popularity38

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity82

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 61.3% 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 ~184 days

Recently: every ~67 days

Total

23

Last Release

88d ago

Major Versions

1.9.6 → 2.0.02022-05-24

PHP version history (4 changes)1.9.1PHP &gt;=5.3.2

1.9.3PHP ^5.3.2 || ^7.0

2.0.0PHP ^8.0

2.4.0PHP ^8.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1073273?v=4)[Andreas Schempp](/maintainers/aschempp)[@aschempp](https://github.com/aschempp)

![](https://avatars.githubusercontent.com/u/481937?v=4)[Yanick Witschi](/maintainers/Toflar)[@Toflar](https://github.com/Toflar)

---

Top Contributors

[![aschempp](https://avatars.githubusercontent.com/u/1073273?v=4)](https://github.com/aschempp "aschempp (38 commits)")[![qzminski](https://avatars.githubusercontent.com/u/193483?v=4)](https://github.com/qzminski "qzminski (17 commits)")[![Toflar](https://avatars.githubusercontent.com/u/481937?v=4)](https://github.com/Toflar "Toflar (4 commits)")[![amenk](https://avatars.githubusercontent.com/u/1087128?v=4)](https://github.com/amenk "amenk (1 commits)")[![taca](https://avatars.githubusercontent.com/u/384611?v=4)](https://github.com/taca "taca (1 commits)")[![zonky2](https://avatars.githubusercontent.com/u/1045318?v=4)](https://github.com/zonky2 "zonky2 (1 commits)")

---

Tags

contaobackendfrontendinserttags

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/terminal42-contao-inserttags/health.svg)

```
[![Health](https://phpackages.com/badges/terminal42-contao-inserttags/health.svg)](https://phpackages.com/packages/terminal42-contao-inserttags)
```

###  Alternatives

[codefog/contao-news_categories

News Categories bundle for Contao Open Source CMS

3183.3k6](/packages/codefog-contao-news-categories)[codefog/contao-haste

haste extension for Contao Open Source CMS

42650.8k139](/packages/codefog-contao-haste)[terminal42/contao-node

Node bundle for Contao Open Source CMS

3172.5k4](/packages/terminal42-contao-node)[terminal42/dcawizard

dcaWizard extension for Contao Open Source CMS

10370.7k15](/packages/terminal42-dcawizard)[contao-community-alliance/dc-general

Universal data container for Contao

1578.3k86](/packages/contao-community-alliance-dc-general)[netgen/layouts-core

Netgen Layouts enables you to build and manage complex web pages in a simpler way and with less coding. This is the core of Netgen Layouts, its heart and soul.

3689.4k10](/packages/netgen-layouts-core)

PHPackages © 2026

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