mirror of
https://github.com/a2nt/silverstripe-elemental-basics.git
synced 2024-10-22 17:05:54 +02:00
IMPR: Add element anchor name
This commit is contained in:
parent
5b887ff222
commit
817b20f5c3
@ -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) {
|
||||||
'AnchorName',
|
$fields->insertBefore(LiteralField::create(
|
||||||
'Element Anchor name: #e'.$obj->ID
|
'AnchorName',
|
||||||
));
|
'<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');
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user