Accessing webform status via reference I have a content type that has a reference to a webform. In the template for this content type, I'd like to check if the referenced webform is open or closed to conditionally display some content.

I have a content.field_ballot[0], but this appears to just be a render array without access to the underlying webform settings.

Is it possible to access it through this reference? Or should I be investigating a different route?

Thanks!
You should avoid any complex PHP code in template files.  I recommend you use a THEME_preprocess_node_MY_CONTENT_TYPE(&amp;$vars) hook to perform your checks, then pass a variable to the template file for your basic validation.  In the preprocess function you pass the variable using $vars['my_custom_variable'] = XYZ and in the template you can call the variable with $my_custom_variable.

Make sure Drupal looks for content type node templates, or you can just use the default THEME_preprocess_node(&amp;$vars) and put a check for your content type in there to keep the full validation code from running.
https://www.drupal.org/node/337022

Stackoverflow discussion along similar lines
https://stackoverflow.com/questions/40645297/pass-variable-to-preprocess-node-function-for-use-in-node-template