Hello,
I am trying to open a view in modal and tried colorbox, and ctools both but could not achieve what I wanted.

with colorbox I tried jQuery.colorbox({html:"<?php print('here'); ?>"}); hoping to replace print statement with views_embed_view() if simple print works, but it didn't.

For ctool, I found a tutorial "https://www.deeson.co.uk/labs/insert-form-pop-modal-ctools-and-drupal-7" which can show forms in modal, but could not find a way of showing view.

Can any of these do the job, or is there any other module/way to achieve this?

Thanks,
Nick

Comments

nick_helps’s picture

Anyone?
Any pointers?

arulraj’s picture

Refer this link will helps you : https://www.drupal.org/node/2704453

nick_helps’s picture

Thanks for the link. I read many other related links, and came across ctools_modal_render($title, $output) function which might have the solution to this problem.

I also followed https://www.drupion.com/blog/10-steps-creating-ctools-modal-window-drupal-7 tutorial to implement this, but it did not work.

  • If I use the URL "happy/js/1" then it says "Fatal error: Call to undefined function ctools_modal_render() ", and
  • If I use the URL "happy/ajax/1" then it throws some JSON string of node 1. May be I am calling it in a wring way.

Does anyone have a working implementation of ctools_modal_render() or any other guidance regarding this or any other possible solution.

nick_helps’s picture

Has no one ever done it yet, or not documented?
This is kind of strange

nick_helps’s picture

This is strange that no one is participating in this discussion.

Come one guys!

Jaypan’s picture

Make your view a block. Output the block using a method here: https://www.drupal.org/node/957038

Use the tutorial you found to output the block instead of a form.