I need to edit the submission HTML view. I have tried using theme_preprocess_webform_submission() and cant seem to get the theme hook to trigger.

What is the best way to alter the HTML in a submission view?

Comments

easp created an issue. See original summary.

jrockowitz’s picture

Status: Active » Closed (works as designed)

You should use hook_ENTITY_TYPE_view_alter

/**
 * Implements hook_webform_submission_view_alter().
 */
function HOOK_webform_submission_view_alter(array &$build, Drupal\Core\Entity\EntityInterface $entity, \Drupal\Core\Entity\Display\EntityViewDisplayInterface $display) {
  // @todo Alter $build['data'].
}