您可以通过 this.theme 访问当前主题对象,它返回对象 Cms\Classes\Theme,引用了 主题自定义对象。
this.theme 将提供对表单字段值的直接访问,这些值由任何主题定制定义。它还原生具有以下属性。
将主题目录名转换为CSS友好的标识符。
<body class="theme-{{ this.theme.id }}">如果主题目录是website这将生成一个类名 theme-website。
一个包含在 theme.yaml 文件中找到的所有主题配置值的数组。
<meta name="description" content="{{ this.theme.config.description }}">