Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apostrophe default value

module.exports = {
    extend: 'apostrophe-widgets',
    label: 'Learn More',
    instructions: 'Learn More Widgets',
    addFields: [
        {
            name: 'learnMore',
            type: 'string',
            label: 'Name for the Link',
            required: false,
        },

    ]
};

How can we set the default value.

like image 486
Grewal Avatar asked Feb 01 '26 14:02

Grewal


1 Answers

I'm the lead developer of Apostrophe at P'unk Avenue.

Just use the def property:

{
  name: 'learnMore',
  type: 'string',
  label: 'Name for the Link',
  required: false,
  def: 'Learn More'
}
like image 51
Tom Boutell Avatar answered Feb 03 '26 11:02

Tom Boutell



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!