Skip to content Skip to footer navigation

Installed Tag

Determine whether or not a Composer package is installed.

A common use case for this tag is if you are building a reusable site (like a Starter Kit) and you'd like
to do something differently depending on whether a package is installed.

Use this as a single tag within an if statement:

{{ if {installed:statamic/seo-pro} }}
{{ seo_pro:meta }}
{{ else }}
{{ partial:seo }}
{{ /if }}
@if (Statamic::tag('installed:statamic/seo-pro')->fetch())
<s:seo_pro:meta />
@else
<s:partial:seo />
@endif

Or as a tag pair. If the package doesn't exist, then nothing between the tag will be output:

{{ installed:statamic/seo-pro }}
{{ seo_pro:meta }}
{{ /installed:statamic/seo-pro }}
<s:installed:statamic/seo-pro>
<s:seo_pro:meta />
</s:installed:statamic/seo-pro>
Hot Tip!

You can pass any Composer package name into this tag. It's not limited to Statamic addons.

A troll pointing a teaching stick