Skip to content

Commit

Permalink
FEATURE Slide - fieldLabels
Browse files Browse the repository at this point in the history
  • Loading branch information
jsirish committed Feb 14, 2024
1 parent 3837181 commit f22a477
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/Model/Slide.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,21 @@ class Slide extends DataObject
'LastEdited',
];

/**
* @param bool $includerelations
* @return array
*/
public function fieldLabels($includerelations = true)
{
$labels = parent::fieldLabels($includerelations);

$labels['Title'] = _t(__CLASS__ . '.TitleLabel', 'Title');
$labels['Image'] = _t(__CLASS__ . '.ImageLabel', 'Image');
$labels['Content'] = _t(__CLASS__ . '.ContentLabel', 'Description');

return $labels;
}

/**
* @return FieldList
*/
Expand All @@ -105,6 +120,7 @@ public function getCMSFields(): FieldList
$fields->replaceField(
'Title',
TextCheckboxGroupField::create('Title')
->setTitle($this->fieldLabel('Title'))
);
} else {
$fields->insertAfter(
Expand Down

0 comments on commit f22a477

Please sign in to comment.