I am creating multiple widgets in apostrophe 2.x which work fine. Now I want to structure and organise them properly. Most of my modules have an option for changing from content-width to browser-width. I am trying to generalise this function without putting the code in every module.
For example in my layout-widget/index.js I have this:
module.exports = {
extend: 'apostrophe-widgets',
label: 'Layout',
addFields: [{
name: 'size',
label: 'Modulbreite',
type: 'select',
choices: [{
label: 'Content width',
value: 'content-width'
},
{
label: 'Full width',
value: 'full-width'
}
],
required: true
}]
};
And now I want to create other widgets that get individual configuration options as well as this selection by extending this general module configuration. File: test-widget/index.js
module.exports = {
extend: 'layout-widgets',
label: 'Test',
addFields: [{
name: 'headline',
label: 'Headline',
type: 'string',
required: true
},
{
name: 'content',
label: 'Add Element',
type: 'area',
options: {
widgets: {
'fact': {},
'text': {}
}
}
}
]
};
But currently I do not see the option for size in my CMS for the test widget. I only see the options directly defined in the test module. Is this even possible or must I insert the size select into every module itself?
Best regards