|
|
@ -42,7 +42,8 @@ class OrcidFieldFormatter extends FormatterBase { |
|
|
|
$prefix = 'https://orcid.org/'; |
|
|
|
$prefix = 'https://orcid.org/'; |
|
|
|
// Assumes all field values are just plain text or strings values and not full orcid URLS. |
|
|
|
// Assumes all field values are just plain text or strings values and not full orcid URLS. |
|
|
|
$orcidUrl = $prefix . $item->value; |
|
|
|
$orcidUrl = $prefix . $item->value; |
|
|
|
$imgSrc = '<img class="orcid-id " src="https://orcid.org/sites/default/files/images/orcid_24x24.png">'; |
|
|
|
$imgSrc = '<a href="'. $orcidUrl . |
|
|
|
|
|
|
|
'"><img class="orcid-id " src="https://orcid.org/sites/default/files/images/orcid_24x24.png"></a>'; |
|
|
|
$link = Link::fromTextAndUrl($orcidUrl, Url::fromUri($orcidUrl)); |
|
|
|
$link = Link::fromTextAndUrl($orcidUrl, Url::fromUri($orcidUrl)); |
|
|
|
$element[$delta] = [$link->toRenderable()]; |
|
|
|
$element[$delta] = [$link->toRenderable()]; |
|
|
|
$element[$delta][0]['#prefix'] = $imgSrc; |
|
|
|
$element[$delta][0]['#prefix'] = $imgSrc; |
|
|
|