How can I open a single Node in a shadowbox?

I've got some Links like this:
<a href="node/123" rel="shadowbox">My link</a>

I want to click on the link an then a Shadowbox should open and show me the node.

But when I click on the link, the background dims out (like it does when a shadowbox is being opened) but no shadowbox appears.

When I put a link to an Image, it works well:
<a href="sites/default/files/example.jpg" rel="shadowbox">My image</a>

I click on the link and the shadowbox appears, showing me the Image. But when I link to a node instead of an image, it doesn't work.

Can you tell me what I'm doing wrong?

CommentFileSizeAuthor
#2 shadowbox.jpg37.57 KBExterior
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jteague’s picture

There are quite a few reasons why this can happen. Does the shadowbox launch at all when trying to include the node? Make sure that you downloaded the version of shadowbox that contains the IFrame extension, which includes 'html' support. You need to make sure that the DOCTYPE for the node you are trying to load into the shadowbox meets the requirement for shadowbox. See: http://shadowbox-js.com/support.html for details. Also, you might want to see of you need to preface your node URL with a "/" like "/node/123" depending. Oh, and you will need to activate shadowbox for your node under admin-settings-shadowbox under "page specific" section.

Exterior’s picture

FileSize
37.57 KB

You save my day =)

I didn't check the HTML support as I've downloaded the shadowbox-files. Now I can open the node in a shadowbox.

But now I've got another problem:

I open the node with a link like this:

<a href="node_popup/123" rel="shadowbox;height=600;width=800;">[title]</a>
(I've written a small module which gives me only the node-content on node_popup/* without any blocks or something else of the site. This is only used for the view in a shadowbox)

The node-background is set to #fff
But when the node-content is short, I get a black bar under my node. (could be seen in the picture I've attached)

How can I change this? I could change the shadowbox-body in shadowbox.css, but in my image gallery I also use shadowbox to open the images an there I want the shadowbox-body to be black, not white.

So can I make the shadowbox-body white but only for this view? Or can I do something else to solve this problem?

Exterior’s picture

Status: Active » Closed (fixed)

Ok, I solved this problem.

I've copied the shadowbox.css, named it shadowbox_white.css an inside off this new stylesheet, I changed the shadowbox-body to have a white background.

Then I put this line to the views header:

<link rel="stylesheet" type="text/css" href="sites/all/libraries/shadowbox/shadowbox_white.css">

And now I have a white shadowbox instead of a black one but only in this view =)

jteague’s picture

I'm glad you got it solved. I tend to import custom stylesheets using views and panels for this kind of thing as well. I suppose others could simply wrap their content in a DIV wrapper and give it a min-height that matches vertical size of the shadowbox or min-height of auto depending on needs and such, but using views and/or panels Drupal makes it pretty easy to override stylesheets.

jteague’s picture

Title: How to open a Node in Shadowbox » How to open a Node in Shadowbox [SOLVED]