Get Site Tag

It gets a site's config, given it's handle.

Overview

This tag lets you get a site's config. It's useful if you need to display information, like site names or URLs, outside of the context of that site.

For example, you might want to output a site's name & logo in your footer:

{{ get_site:english }}
<a href="{{ permalink }}">
Go to {{ name }}
</a>
{{ /get_site:english }}
<s:get_site:english>
<a href="{{ $permalink }}">
Go to {{ $name }}
</a>
</s:get_site:english>

You can also alias the result, if you need to:

<s:get_site:english as="the_site">
{{ $the_site->name }}
</s:get_site:english>

If you need to, you can pass the site handle dynamically:

{{ get_site :handle="another_sites_handle" }}
<!-- ... -->
{{ /get_site }}
<s:get_site :handle="$another_sites_handle">
<!-- ... -->
</s:get_site>

You can also use it as a single tag:

{{ get_site:english:permalink }}
{{-- Using Antlers Blade Components --}}
<s:get_site:english:permalink />
 
{{-- Using Fluent Tags --}}
{{ Statamic::tag('get_site:english:permalink') }}
Docs feedback

Submit improvements, related content, or suggestions through Github.

Betterify this page →