You are here

function _nd_preprocess_node in Display Suite 6.3

Helper function used in either nd_preprocess_node or other preprocess function.

1 call to _nd_preprocess_node()
nd_preprocess_node in modules/nd/nd.module
Implementation of moduleName_preprocess_hook(). The node data will be rendered in regions. This uses a helper function so themers/developers can call that helper function from within their preprocess_hooks if they are fiddling with some data. For…

File

modules/nd/nd.module, line 271
Node displays.

Code

function _nd_preprocess_node(&$vars, $hook) {
  $node = $vars['node'];

  // Break all the rendering if needed.
  if (!$node->render_by_ds) {
    return;
  }

  // Add nd-content_type-build_mode(-nid) template suggestion.
  $vars['template_files'][] = 'nd';
  $vars['template_files'][] = 'nd-' . $node->type;
  $vars['template_files'][] = 'nd-' . $node->type . '-' . $node->build_mode;
  $vars['template_files'][] = 'nd-' . $node->type . '-' . $node->build_mode . '-' . $node->nid;
  $vars['content'] = $node->ds
    ->render();
}