room9 / globalmetadata
允许设置全局 MetaTitle 和 MetaDescription 字段,这些字段可以在单个页面上进行覆盖。
v1.0.0
2017-03-01 20:07 UTC
Requires
- silverstripe/cms: ~3.2
- silverstripe/framework: ~3.2
This package is auto-updated.
Last update: 2024-09-15 13:59:23 UTC
README
本模块允许你在网站设置中设置默认的 MetaTitle 和 MetaDescription,这些可以在单个页面上进行覆盖。
维护者联系方式
Nathan Cox (nathan@room9.co.nz)
需求
- SilverStripe 3.2+
文档
安装说明
解压到名为 globalmetadata 的根目录中,然后运行 dev/build。
即将推出:composer
使用概述
如果启用了 MetaTitle,它将为每个页面添加一个字段。然后当调用页面的 MetaTitle() 时(例如在模板中),它将首先使用此字段的值。如果该字段为空,则回退到设置中定义的 MetaTitle。如果那个也为空,则使用页面的标题。如果你在模板中使用带标题显示的 $MetaTags,它将使用 MetaTitle() 输出标题标签。否则,它可以在模板中使用 $MetaTitle 访问。
MetaData 与 MetaTitle 的工作方式相同。如果页面没有设置 MetaDescription,则 $MetaTags() 将输出一个包含设置中默认描述的 meta 描述元素。
配置选项
SiteConfig: show_meta_title: true // turn on/off the meta title fields and behaviour show_meta_description: true // turn on/off the meta description field and behaviour meta_title_description: '' // set text that appears under the default meta title field meta_description_description: '' // set text that appears under the default meta description field Page: meta_title_description: '' // set text that appears under the page meta title field meta_description_description: '' // set text that appears under the page meta description field
问题
请 创建一个问题,如果您发现了任何错误,或者缺少任何功能。