Skip to content

Commit

Permalink
Merge pull request #1109 from dsenalik/20201016chado_linker__prop_for…
Browse files Browse the repository at this point in the history
…matter

Tripal field URLs made clickable
  • Loading branch information
spficklin committed Oct 20, 2020
2 parents b8c1c67 + b99e23f commit 565f1e9
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ class chado_linker__prop_formatter extends ChadoFieldFormatter {

$list = [];
foreach ($items as $index => $item) {
$list[$index] = $item['value'];
$value = $item['value'];
// any URLs are made into clickable links
if ( preg_match('/^https?:/i', $value) ) {
$value = l($value, $value, ['external' => 'TRUE', 'attributes' => ['target' => '_blank']]);
}
$list[$index] = $value;
}

// Also need to make sure to not return markup if the field is empty.
Expand Down

0 comments on commit 565f1e9

Please sign in to comment.