Radical Design Course by Jack McDade

From the creator of Statamic

Learn how to make your websites standout and be remembered.

For a software dev like me who has no idea how to create a cute hand-drawn dashed line, this course just 100% works.

— Ira Zayats, Developer

site

The current site being targeted in the request.

It's a Statamic\Sites\Site object and can be used as a single tag or tag pair.

// config/statamic/sites.php
 
'sites' => [
'default' => [
'name' => 'My Statamic Site',
'locale' => 'en_US',
'url' => '/',
'direction' => 'ltr',
'attributes' => [
'foo' => 'bar',
],
]
]

As a single tag, it will output the handle of the site:

{{ site }}
{{ $site }}
default

As a tag pair, you can access additional information:

{{ site }}
{{ handle }}
{{ name }}
{{ locale }}
{{ short_locale }}
{{ url }}
{{ permalink }}
{{ direction }}
{{ attributes }}
{{ foo }}
{{ /attributes }}
{{ /site }}
{{ $site->handle }}
{{ $site->name }}
{{ $site->locale }}
{{ $site->short_locale }}
{{ $site->url }}
{{ $site->permalink }}
{{ $site->direction }}
 
{{ $site->attributes['foo'] }}
default
My Statamic Site
en_US
en
/
http://mysite.com/
ltr
bar

You can also access those variables directly as single tags:

{{ site:name }}
{{ site:attributes:foo }}
{{ $site->name }}
{{ $site->attributes['foo'] }}
My Statamic Site
bar
Docs feedback

Submit improvements, related content, or suggestions through Github.

Betterify this page →