Browse Source

Tripal field URLs made clickable v.2

dsenalik 4 years ago
parent
commit
b99e23f369

+ 1 - 1
tripal_chado/includes/TripalFields/chado_linker__prop/chado_linker__prop_formatter.inc

@@ -30,7 +30,7 @@ class chado_linker__prop_formatter extends ChadoFieldFormatter {
       $value = $item['value'];
       // any URLs are made into clickable links
       if ( preg_match('/^https?:/i', $value) ) {
-        $value = t('<a href="!url">!url</a>', ['!url' => $value]);
+        $value = l($value, $value, ['external' => 'TRUE', 'attributes' => ['target' => '_blank']]);
       }
       $list[$index] = $value;
     }