bootstrap_storybook-8.x-2.0/includes/comment.inc
includes/comment.inc
<?php
/**
* @file
* Theme and preprocess functions for comments.
*/
/**
*
*/
function bootstrap_storybook_theme_suggestions_comment_alter(array &$suggestions, array $variables) {
/** @var \Drupal\comment\CommentInterface $comment */
$comment = $variables['elements']['#comment'];
$commented_entity = $comment
->getCommentedEntity();
$variables['comment'] = $comment;
$variables['commented_entity'] = $commented_entity;
$sanitized_view_mode = strtr($variables['elements']['#view_mode'], '.', '_');
// Add view mode theme suggestions.
$suggestions[] = 'comment__' . $sanitized_view_mode;
}
