Is there any way to display a node page in the ctools modal.

I have searched for a contrib module but did not find one.

I know the following code will display the content in ctools modal, but can't figure out how to use it for a node.

$popup_content = 'some content;
$output = array();
$output[] = ctools_modal_command_display(t('Confirmation'), $popup_content);
print ajax_render($output);

As I have a view displaying nodes with read more link. When I click on the readmore, that node should display in ctools modal.

I know I can figure out a solution for this problem is to create a path like article/% and in the callback I will load the node and will use the above code to display the node content.

But I'm looking for a clean solution, where the readmore should link to node/[nid] in actual but with node alias. and the node page appears in ctools modal.

  • Not sure: is your question how to print the node in the modal or how to create the node/[nid] path that will invoke the modal? – longboardnode Mar 10 '17 at 16:49

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.