您可以通过 this.page 访问当前页面对象,它返回对象 Cms\Classes\Page。此对象也可以在 页面PHP代码 中通过 $this->page 访问。
this.page 具有以下属性。
如果已定义,则引用此页面使用的布局名称。不要与 this.layout 混淆。
{{ this.page.layout }}将页面文件名和文件夹名转换为一个 CSS 友好的标识符。
<body class="page-{{ this.page.id }}">如果页面文件是home/index.htm 这将生成一个类名page-home-index。
由配置定义的页面标题。
<h1>{{ this.page.title }}</h1>由配置定义的页面描述。
<p>{{ this.page.description }}</p>一个备用的 title 字段,通常更具描述性,用于 SEO 目的。
<title>{{ this.page.meta_title }}</title>替代的 description 字段,通常更具描述性,用于 SEO 目的。
<meta name="description" content="{{ this.page.meta_description }}">隐藏页面仅限已登录的后台用户访问。
{% if this.page.hidden %}
<p>Note to other admins: We are currently working on this page.</p>
{% endif %}页面文件名在主题中带扩展名
主题中的页面文件名,不带扩展名。