mirror of
https://github.com/silverstripe/silverstripe-comments
synced 2024-10-22 11:05:49 +02:00
fix: field formatting to correct include link
This commit is contained in:
parent
6782048463
commit
d87dbc8367
@ -27,12 +27,16 @@ class CommentsGridFieldConfig extends GridFieldConfig_RecordEditor
|
||||
/** @var GridFieldDataColumns $columns */
|
||||
$columns = $this->getComponentByType(GridFieldDataColumns::class);
|
||||
$columns->setFieldFormatting([
|
||||
'ParentTitle' => function ($value, &$item) {
|
||||
return sprintf(
|
||||
'<a href="%s" class="cms-panel-link external-link action" target="_blank">%s</a>',
|
||||
Convert::raw2att($item->Link()),
|
||||
$item->obj('ParentTitle')->forTemplate()
|
||||
);
|
||||
'Parent.Title' => function ($value, &$item) {
|
||||
if ($link = $item->Link()) {
|
||||
return sprintf(
|
||||
'<a href="%s" class="cms-panel-link external-link action" target="_blank">%s</a>',
|
||||
Convert::raw2att($link),
|
||||
$item->obj('ParentTitle')->forTemplate()
|
||||
);
|
||||
} else {
|
||||
return $item->obj('ParentTitle')->forTemplate();
|
||||
}
|
||||
}
|
||||
]);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user