为页面设置添加更多字符SEO描述和字段

问题描述 投票:3回答:1

我正在为我们的网站运行SEO,我们的网站正在使用Apostrophe-cms。但是,SEO Description字段的限制为155个字符。 SEO描述: SEO Description

我想在页面设置中再添加一个字段,例如文本字段。页面设置: Page Setting

你能帮我指点一下我可以调整这些要求的代码吗?

apostrophe-cms
1个回答
3
投票

我是P'unk Ave的开发人员,是ApostropheCMS的创始人和管家。看起来你正在使用旧版本Apostrophe 0.5。你可以在respective docs site上找到一些文档。

要在页面设置上添加额外字段,您需要利用Apostrophe Fancy Page module。只需npm install apostrophe-fancy-page并将您想要的页面类型扩展为apps.js中的模块,如下所示:

  pages: {
    {
      name: 'my-page',
      label: 'My Page'
    }
  },
  modules: {
    'some-module': {},
    'some-other-module': {},
    'my-page': {
      extend: 'apostrophe-fancy-page',
      name: 'my-page',
      label: 'My Page',
      addFields: [
        {
          name: 'textField',
          label: 'New Text Field',
          type: 'string'
        }
      ]
    },
  }

确保您的新花式页面模块与您要扩展的页面类型具有相同的name。重新启动服务器,您应该有新的页面设置字段。

如果您想将这些数据吐出到页面上,您现在可以在页面模板中调用类似的内容:

{{ page.textField }}

一定要看看latest version of ApostropheCMS!使用plans for 3.0 underway进行2.0的很多很酷的东西。

© www.soinside.com 2019 - 2024. All rights reserved.