I succesfully get user name, surname and date to render in comment.html.twig like this
function MYTHEMENAME_preprocess_comment(&$variables) {
$comment = $variables['comment'];
$variables['user_name_comment'] = $comment->getOwner()->field_first_name->value;
$variables['user_surname_comment'] = $comment->getOwner()->field_last_name->value;
$variables['created'] = Drupal::service('date.formatter')->format($variables['comment']->getCreatedTime(), 'conference_date');
}
In node template i got field_picture to render like this
$variables['author_picture'] = $node->getOwner()->field_picture->entity->url();
But i can’t get my field_picture from user to render in comment twig file. I try to show the author’s picture of every comment.
Any ideas?