render() is not returning anything on custom theme I am using the newsletter_export module to allow users to select multiple nodes and export them as html. The node this action is performed on is a content type which uses entity reference to grab content from selected other nodes. The newsletter_export is also the name of the template file which renders it. It depends on the node_export module to do this.

However, it doesn't work on the theme that I am working with. It works fine on the Bartik theme. The code in the module that doesn't work is below: the variable for $raw_markup is always empty.

This level of coding in Drupal is new to me so any tips on fixing or just where to look to fix the problem is really appreciated! The variable $item is just the nid of the node.

$node = node_load($item);

  // TODO: Should we add the check for view hook back in for custom node modules?
  // Filter and prepare node in our custom build mode
  $render_array = node_view_multiple(array($item =&gt; $node), 'newsletter_export'); //, $weight = 0, $langcode = NULL)

  // TODO: Allow modules to change $node-&gt;content before the node is rendered.
  //node_invoke_nodeapi($item, 'view', $teaser, FALSE);
  $type = 'node';
  drupal_alter(array('node_view', 'entity_view'), $render_array, $type);

  // TODO: Set the proper node property, then unset unused $node property so that a
  // bad theme can not open a security hole.

  $raw_markup = render($render_array);
Simple, and frustrated I spent so long on this.

I copied the tpl file from the module to my theme assuming I could customise it there. But when I deleted it from my theme directory it just started working. The template page inheritance is confusing...