12

is it possible to load a node (from an id) into a lightbox 2 without having to load all the additional blocks ? just what the node has to display

I want to make some popups on some links to allow some nodes to be shown inside.. no submission will be made in this case (comments are disabled)

another cool thing will be including webforms in a lightbox.. Again no headers..but I believe that that's more complicated because it's form submission... so ajax in required

1

2 Answers 2

5

There are many ways to do this, and this gets asked a lot, please have a look at my answer in this question.

Look at this doc page from the Lightbox2 documentation.

Right now though I highly recommend using the Modal Frame API and Automodal for things like this.

** Drupal 7 update

The colorbox module doesn't offer out of the box support for nodes yet (they are working on a patch for this), but in the meantime you can use this approach. You can also use the Shadowbox module, have a look at this and this issue.

5
  • those modules are D6. Do you have a recommendation for D7?
    – uwe
    Oct 11, 2011 at 1:50
  • I´m using D7 as well
    – PartySoft
    Oct 11, 2011 at 10:31
  • 1
    Updated my answer.
    – ipwa
    Oct 14, 2011 at 1:11
  • @ipwa Thank you. But does it work in D7? I tried in my site this: <a href="node/xxx/lightbox2" rel="lightframe">click here to see node content</a> But it didn't work. Node is shown with the sidebar, footer, blocks etc.
    – trante
    Apr 8, 2012 at 17:08
  • use page-node-lightbox2.tpl.php you could specify to print the $node variable by itself without all the sidebars, etc, and style it the way you want
    – Sibiraj PR
    Mar 6, 2013 at 5:35
1

I know in D6 if you linked to http://your/target/url #content-inner then it would only display that div in the Lightbox!

Example:

<a class="lightbox-processed" rel="lightmodal[search|width:400px; height:470px; scrolling:none;]" href="/request-callback #content-inner">

Obviously use Firebug or the like to find out which div ID you want to display and replace #content-inner with that (making sure to include the space between the URL and the div ID) :-)

Hope this helps!

Your Answer

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

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