0

I wanted to display node view in popup through ctools modal.

For which I have created a menu path modal/%ctools_js/%node and in the menu callback below code is defined:

if ($js) {
    ctools_include('modal');
    ctools_include('ajax');
    //Default CTools JS.
    ctools_modal_add_js();
  }

  // Load the node object.
  $node = node_load($nid);
  // Render content in 'FULL' view mode.
  $content = node_view($node, 'full', NULL);
  $contents = render($content);

  return ctools_modal_render($node->title, $contents);
}

with this node, content is getting displayed in modal popup but raw data is coming up, the node--article.tpl.php template is not getting called.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.