2

I have a column widget that I'm trying to create a prepopulated dropdown list that a user can choose from that will correspond to a value of bootstrap class names "col-md-6" etc.

addFields: [
    {
      type: 'select',
      name: 'column1width',
      label: 'Column 1 Width',
      contextual: false,
      options: {
         name: '1 column',
         value: 'col-md-1'
       },
       {
         name: '2 column',
         value: 'col-md-2'
       }
    },
Brad Wood
  • 93
  • 5

1 Answers1

3

I figured out the answer

  type: 'select',
      name: 'column1width',
      label: 'Column 1 Width',
      contextual: false,
      choices: [
        {
          label: '1 Column',
          value: 'col-md-1'
        },
        {
          label: '2 Column',
          value: 'col-md-2'
        }
      ]
Brad Wood
  • 93
  • 5
  • 2
    Yep! FWIW, we often use snippets to speed up creating schemas. If you're using Atom or VS Code you can find those here: https://atom.io/packages/apostrophe-atom https://marketplace.visualstudio.com/items?itemName=punkave.apostrophecms-vs-snippets – Alex Gilbert Oct 07 '17 at 00:17
  • I downloaded the snippets but wasn't sure how to get them to show up in atom. Also documentation isn't very clear how to set default value for select – Brad Wood Oct 09 '17 at 14:07