I would like to have the ability to include a custom option in the field layout designer field settings. There is already a plugin for Craft 2 that uses this feature Relabel for Craft
And I would like to include a behavior like this in Craft 3 too but I can't find a way to solve this issue.
The FieldLayoutDesigner is initialized here and the settings are created with
initTab: function($tab) {
if (this.settings.customizableTabs) {
var $editBtn = $tab.find('.tabs .settings'),
$menu = $('<div class="menu" data-align="center"/>').insertAfter($editBtn),
$ul = $('<ul/>').appendTo($menu);
$('<li><a data-action="rename">' + Craft.t('app', 'Rename') + '</a></li>').appendTo($ul);
$('<li><a data-action="delete">' + Craft.t('app', 'Delete') + '</a></li>').appendTo($ul);
new Garnish.MenuBtn($editBtn, {
onOptionSelect: $.proxy(this, 'onTabOptionSelect')
});
}
// Don't forget the fields!
var $fields = $tab.children('.fld-tabcontent').children();
for (var i = 0; i < $fields.length; i++) {
this.initField($($fields[i]));
}
},
But I don't see any triggers or other options to extend the content. Can someone please point me to the right direction how to include a custom button properly?
I think waiting for the click
event on the wheel icon and wait until the DOM menu is created to attach a custom button might not be the best and intended idea?
Thank you very much.