3

I'm running SEO for our website and our website is using Apostrophe-cms. However, SEO Description field has the limit 155 characters. SEO Description:
SEO Description

And I want to add one more field in Page Setting such as Text field. Page Setting:
Page Setting

Could you help to guide me where is the file could I adjust the code for these requirement?

K.Dᴀᴠɪs
  • 9,945
  • 11
  • 33
  • 43
Alviss Tran
  • 41
  • 1
  • 5
  • Inline images; removed tags from title; noise reduction; layout. // https://stackoverflow.com/review/helper/18967587 – K.Dᴀᴠɪs Mar 01 '18 at 01:10

1 Answers1

3

I'm a developer at P'unk Ave, creators and stewards of ApostropheCMS. Looks like you're working with the legacy version, Apostrophe 0.5. You can find some documentation on the respective docs site.

To add an extra field on the page settings, you'll want to leverage the Apostrophe Fancy Page module. Just npm install apostrophe-fancy-page and extend your desired page types as modules in your apps.js like so:

  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'
        }
      ]
    },
  }

Be sure your new fancy page module has the same name as the page type you are extending. Restart your server and you should have the new page setting field.

If you want to spit this data onto the page, you can now call something like this in your page template:

{{ page.textField }}

Be sure to check out the latest version of ApostropheCMS as well! Lots of cool stuff going on for 2.0 with plans for 3.0 underway.

mtthwmnc
  • 31
  • 3