In Drupal 8 routes like entity.node.webform.user.submissions (path such as /node/2/submissions), entity.node.webform_submission.canonical (path such as /node/2/submission/118) etc etc display entity view in the main content block. My question how would I append/pre-append/insert html elements (such as link tag,submit button, textfield etc etc) in the entity view.For example if the view shows a table listing submissions how to pre-append a link button at the top right corner of the table. I have tried:

function my_module_entity_view_alter(array &$build, EntityInterface $entity, EntityViewDisplayInterface $display){

In kint($build) and kint($entity) I can't see any part where to add HTML markup. How and where should I add it?


The Webform module for Drupal 8 does not fully support display modes. To alter a submission's HTML or text you will need to use hook_preprocess_webform_submission_html() and hook_preprocess_webform_submission_text().

I created a ticket on D.O. to look into this issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.