您可以通过 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 }}">