I've created a table style view with a few content fields. Most of the fields are node reference. I'm trying to display the content of the referenced node in a modal from views links feature.
I've added this php to the header section of the view.
<?php {
ctools_include('modal');
ctools_modal_add_js();
}
?>
I've selected my field to use "Output this field as a link". From the 'link path' I'm using the token for my field and it seems like that is setup fine. For the 'link class' I have entered 'ctools-use-modal'
After I save the view, I return and click the linked field. A modal box does popup. The title says 'Loading...'. After a few seconds I get 'An error occurred at /mysite/path-to-node'. The path that is being displayed as an error looks to be the correct path I want.
Do I need to make a small module to tap into some more functionality from ctools for the linked field to be rendered inside the modal?
Any suggestions or pointers would be greatly appreciated.
Comments
Comment #1
aaronbaumandid you ever figure this out?
i'm trying to do similar in d7
Comment #2
warmth commentedThis should become a module like Modal Forms! I don't like how the nodes look in Colorbox or Lightbox2!
Comment #3
ankitchauhan commentedNo need to create separate module. Add this code into header of your view, this is for default modal popup. Create a global text area and place the code below with text format php
If you want custom modal popup add this also to header
you can customize accordingly. Then create a custom module and implement hook_node_view() and put the following code
Now in you view, select any view field, on which you want to show modal popup (i.e. content it or content title),
It worked for me, hope for you too.
Comment #4
ankitchauhan commentedforgot one thing
you wound need to enable ctools_ajax_sample module
Comment #5
aaronbaumanI ended up using colorbox_node
Comment #6
damienmckennaPlease only change the issue status to "needs review" when there's an actual patch to test. Thank you.
Comment #7
maximpodorov commentedYou can also try https://www.drupal.org/project/modal
Comment #8
2alokjha commentedGetting Ajax http error
Comment #9
supriyarajgopal commentedHi,
Find my solution here.
Regards,
Supriya Rajgopal
Comment #10
mustanggb commented