Skip to content

Commit 6a23db3

Browse files
committed
Don't truncate generated field values within cards
Resolves #18646
1 parent d323f69 commit 6a23db3

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

CHANGELOG-WIP.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
- Added the “Time Zone” user preference. ([#8518](https://github.com/craftcms/cms/discussions/8518))
2020
- Element indexes now automatically refresh after duplicating elements and the queue is completed, if there’s an active search term. ([#18636](https://github.com/craftcms/cms/issues/18636))
2121
- Timestamps in the control panel now include their time zone abbreviation. ([#18639](https://github.com/craftcms/cms/pull/18639))
22+
- Generated field values are no longer truncated within element cards. ([#18646](https://github.com/craftcms/cms/discussions/18646))
2223

2324
### Administration
2425
- Time fields’ “Max Time” settings can now be set to an earlier time than “Min Time”, for overnight time ranges. ([#18575](https://github.com/craftcms/cms/pull/18575))

src/models/FieldLayout.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1338,7 +1338,11 @@ private function cardHtmlForGeneratedField(string $key, ?ElementInterface $eleme
13381338
}
13391339

13401340
if ($element) {
1341-
return $element->getGeneratedFieldValues()[$uid] ?? null;
1341+
$html = $element->getGeneratedFieldValues()[$uid] ?? null;
1342+
if (!$html) {
1343+
return null;
1344+
}
1345+
return Html::tag('div', $html, ['class' => 'no-truncate']);
13421346
}
13431347

13441348
return Html::encode($field['name'] ?? '');

0 commit comments

Comments
 (0)