mirror of
https://github.com/symbiote/silverstripe-gridfieldextensions.git
synced 2024-10-22 17:05:39 +02:00
Adding possibility to define a custom text for the link
This commit is contained in:
parent
9a253f27f2
commit
4c8009ad02
@ -59,7 +59,8 @@ class GridFieldExternalLink extends GridFieldDataColumns {
|
||||
*/
|
||||
public function getColumnContent($gridField, $record, $columnName) {
|
||||
$data = new ArrayData(array(
|
||||
'Link' => $record->hasMethod('getExternalLink') ? $record->getExternalLink() : $record->ExternalLink
|
||||
'Link' => $record->hasMethod('getExternalLink') ? $record->getExternalLink() : $record->ExternalLink,
|
||||
'Text' => $record->hasMethod('getExternalLinkText') ? $record->getExternalLinkText() : 'External Link'
|
||||
));
|
||||
|
||||
return $data->renderWith('GridFieldExternalLink');
|
||||
|
@ -1 +1 @@
|
||||
<a href="$Link" target="_blank" title="<% _t('GridFieldExtensions.ExternalLink','External Link') %>"><% _t('GridFieldExtensions.ExternalLink','External Link') %></a>
|
||||
<a href="$Link" target="_blank" title="$Text">$Text</a>
|
||||
|
Loading…
Reference in New Issue
Block a user