Skip to content

Commit

Permalink
Merge pull request #1797 from bolt/fix/allow-contenttype-in-title-for…
Browse files Browse the repository at this point in the history
…matting

Allow `contenttype` in title formatting (For "Select" fields)
  • Loading branch information
I-Valchev authored Sep 1, 2020
2 parents a0a42dc + 85c5d84 commit e51f15d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Utils/ContentHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ function ($match) use ($record, $locale) {
return $this->localeExtension->localdate($record->getDepublishedAt(), null, $locale);
}

if ($match[1] === 'contenttype') {
return $record->getDefinition()['singular_name'];
}

if ($record->hasField($match[1])) {
$field = $record->getField($match[1]);

Expand Down

0 comments on commit e51f15d

Please sign in to comment.