0

Have been struggling with view and modal to display related node content for a few days, but in vain.

In view, a page is to display / list only thumbnail images (Display Suite) with rewritten link to trigger the modal with data-target. Then bootstrap modal code is placed in page.tpl.php.

So on view page, on click the thumbnail, the modal shows up. The problem is how to display title, body and images? Tried <?php print $node->title; ?> but when refreshing the view page, it shows blank page.

Is it not possible to display related node content of the thumbnail on modal?

Have tried Bootstrap modal and JQuery Ajax Load but they don't work at all. Documentation isn't clear either.

Help very much appreciated

2
  • Your view should include the fields you want to show in your modal. For example, if you want to later display the title, it should be in the "Fields" in your view. Or are you trying to show your full node in your modal?
    – typologist
    Commented Jul 13, 2015 at 20:04
  • @typologist - if I add all fields, it will show list of thumbnail with node fields which I do not want. I want only to show thumbnails on portfolio page. Then click on thumbnail and modal should be appearing which it doesn't. And how to show fields on modal from different view?
    – joe
    Commented Jul 14, 2015 at 3:54

1 Answer 1

0

If you want to show your node in a modal, a simpler approach would be to use the Colorbox and the Colorbox node modules (the last one has Views integration).

So after installing both modules, go to your View; in your Fields, when you click on any of them, you will see that the option "Link this field to the original piece of content" now has another one that says "Display the content inside of a colorbox". Check it, and it will make your nodes open in a modal window (colorbox).

6
  • it sounds easy but the problem is how to display thumbnails on the full page and then have the thumbnails display modal with node fields on click? Does it require 2 views to be linked together?
    – joe
    Commented Jul 21, 2015 at 13:30
  • No, you don't need 2 views. You can use the view you already have. Just go to the field you want to be clickable and check the "Display the content inside a colorbox". After doing that, your node will open in a modal.
    – typologist
    Commented Jul 21, 2015 at 14:46
  • thanks for the help. One last question: may i know if it is possible to add in bootstrap carousel on colorbox modal?
    – joe
    Commented Jul 21, 2015 at 15:23
  • You're very welcome! Please, consider accepting this answer if you think it helped you, so it can help others too in the future. About the carousel, I don't know inside the colorbox modal (never tried that myself), but maybe if you open a new question for this, we'll be able to help you better.
    – typologist
    Commented Jul 21, 2015 at 15:35
  • will do after i test these 2 modules and if it works. thanks so much for your help
    – joe
    Commented Jul 21, 2015 at 15:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.