Radical Design Course by Jack McDade

From the creator of Statamic

Learn how to make your websites standout and be remembered.

Bought Jack McDade's course on design. Going through it now...and it is SO well done!

— Justin Jackson, Transistor.fm

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.

Docs feedback

Submit improvements, related content, or suggestions through Github.

Betterify this page →