function uikit_preprocess_links__comment

8.x-3.x preprocess.inc uikit_preprocess_links__comment(&$variables)

File

includes/preprocess.inc, line 370
Set up variables to be placed within the template (.html.twig) files.

Code

function uikit_preprocess_links__comment(&$variables) {
  foreach ($variables ['links'] as $key => $link) {
    if (isset($link ['link'])) {
      $url = $link ['link']['#url']->toString();
      $title = $link ['text']->getUntranslatedString();
      $variables ['links'][$key]['link'] = [
        'title' => t('@title', ['@title' => $title]),
      ];
      $variables ['links'][$key]['link']['attributes'] = new Attribute();
      $variables ['links'][$key]['link']['attributes']->setAttribute('href', $url);
      $variables ['links'][$key]['link']['attributes']->addClass('uk-link-muted');
    }
  }
}

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.

Log in