'; private static $table_name = 'LinksWidget'; private static $many_many = [ 'Links' => Link::class, ]; private static $owns = [ 'Links', ]; public function getCMSFields() { $fields = parent::getCMSFields(); if($this->ID) { $fields->push(GridField::create( 'Links', '', $this->Links(), GridFieldConfig_RecordEditor::create() )); }else{ $fields->push(LiteralField::create( 'Note', '

Note: The widget needs to be saved before adding a link.' .' Enter the Title and click "+ Create" button at the bottom left corner of the screen

') ); } return $fields; } }