function uikit_preprocess_field__comment

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

File

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

Code

function uikit_preprocess_field__comment(&$variables) {
  $comments = $variables ['comments'];
  $comment_count = 0;

  foreach ($comments as $comment) {
    if (isset($comment ['#comment'])) {
      $comment_count++;
    }
  }

  $variables ['comment_count'] = $comment_count;
}

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