- 🇬🇧United Kingdom altcom_neil
Hi, the simplest fix I found was simply to check the value is not empty and set the attribute to NULL if it is:
diff --git a/block_title_link.module b/block_title_link.module index c56cfba..351ec7e 100644 --- a/block_title_link.module +++ b/block_title_link.module @@ -93,8 +93,8 @@ function block_title_link_preprocess_block(&$variables) { '#title' => $blockLabel, '#url' => Url::fromUri($tileLink), '#attributes' => [ - 'target' => $linkTarget, - 'title' => $linkTitle, + 'target' => $linkTarget ?: NULL, + 'title' => $linkTitle ?: NULL, ], ]; }
The attributes are then not rendered if the value is NULL.