0
votes

Hi guys ,

I'm currently working on a Drupal project which use the Panelizer module by overriding the default node display. The panel for this content type is made width a lot of rules and specifications in order to display some specific content (like views) according some fields.

Now I need to print in PDF the same content that is displayed by the panelizer module but in another display (in one column ), so I cloned the display I use and rearranged it to display what I want.Then I want to use this display width the print module but I didn't managed to do that. Any idea how can I do that ?

I just can't use the default node render, because I would miss some informations dues to the specifications used in the panel, and I can't print the panelized content because it's not the same display.

I read this thread but how can I say to the print module to use the "print" display I cloned instead of the default one ?

Any suggestions or ideas will be appreciated or if you have another idea for doing that you're welcome :)

Thank you !

2

2 Answers

0
votes

In your print pdf template you can load the node then create a view with the display and finally render it : drupal_render(node_view(node_load($node->nid), "name of your display")) ;

0
votes

Another way is to alter node entity info, telling that 'print' view can be panelized, i.e.

/**
 * Implements hook_entity_info_alter().
 */
function mymodule_entity_info_alter(&$entity_info) {
  $entity_info['node']['view modes']['print']['custom settings'] = TRUE;
  ...
}

After that, you go to panelizer settings of your content type(s), and set whatever you want for the print view mode