Different view modes can be created on entities by modules like Display Suite and Entity View Modes. Right now, there's no way to identify those view modes w/in templates. An example of this is: I can't create a webform-submission--full.tpl.php file or a webform-submission--my-mode-here.tpl.php. that has different formatting of the overall submission.

Part of the blame here is webform's submission display system, which doesn't actually support view modes, and instead requires their 'display format' to be either FORM or HTML. This means that the correct entity view mode passed in via entity_view() can't be what goes to the webform module's function for viewing submissions. Instead the only real way around this is to pass the view_mode in as part of the submission object, and let other modules use hook_preprocess_webform_submission() to declare a template candidate for their view mode of choice.

This one-liner patch gives modules that ability should they so desire.

Hope this helps!

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

netw3rker created an issue. See original summary.

netw3rker’s picture