IMPR: Add element anchor name

This commit is contained in:
Tony Air 2023-11-17 00:03:42 +02:00
parent 5b887ff222
commit 817b20f5c3

View File

@ -29,10 +29,14 @@ class BaseElementEx extends DataExtension
$obj = $this->owner; $obj = $this->owner;
parent::updateCMSFields($fields); parent::updateCMSFields($fields);
$fields->addFieldToTab('Root.Main', LiteralField::create( if ($obj->ID) {
$fields->insertBefore(LiteralField::create(
'AnchorName', 'AnchorName',
'Element Anchor name: #e'.$obj->ID '<div class="field"><div class="form__field-holder">'
)); .'Element Anchor name: <b>#e'.$obj->ID.'</b>'
.'</div></div>'
), 'Title');
}
$tab = $fields->findOrMakeTab('Root.Settings'); $tab = $fields->findOrMakeTab('Root.Settings');