您可以通过 this.site 访问活动站点 并且它返回对象 System\Models\SiteDefinition 当前站点定义。
{{ this.site.id }}
{{ this.site.name }}
{{ this.site.code }}
{{ this.site.locale }}
{{ this.site.timezone }}
{{ this.site.theme }}{% if this.site.code === 'english' %}
<h1>Only display for English</h1>
{% endif %}locale 属性如果已指定,将返回当前区域设置,或在未指定时返回空值。
<html lang="{{ this.site.locale }}">使用 hard_locale 属性可始终返回区域设置值,该值在未指定区域设置时使用默认区域设置。
<html lang="{{ this.site.hard_locale }}">