2 * Implements hook_comment_view_alter().
4 function {{ machine_name }}_comment_view_alter(&$build) {
5 // Check for the existence of a field added by another module.
6 if ($build['#view_mode'] == 'full' && isset($build['an_additional_field'])) {
8 $build['an_additional_field']['#weight'] = -10;
11 // Add a #post_render callback to act on the rendered HTML of the comment.
12 $build['#post_render'][] = 'my_module_comment_post_render';