I want to use fancybox to create a pop-up which shows another node. I use a CCK field with a class attribute to generate the link.

The other node has it's one template file, as follows:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="<?php print $language->language; ?>" xml:lang="<?php print $language->language; ?>">

<head>
  <title><?php print $head_title; ?></title>

  <?php print $head; ?>
  <?php print $styles; ?>
  <?php print $scripts; ?>
</head>

<body>

<?php print $node->field_p_body[0]['value']; ?>
<?php print $closure; ?>
</body>
</html>

To be able to display the node I tried several things. (I still did not figure out how to add my own selector property, adding it via the admin interface seems to generate some \ characters which are not allowed.)

  • I tried adding just the iframe class element to the link. The page opens in the same window, not in a pop-up.
  • I tried using the imagefield class which is provided by the module. This doesn't work, a full white page is loaded and shows the fancybox loading circle, but seems to "hang" on that page.

I took it a step further and tried the second option with a small HTML page I uploaded via FTP and for some strange reason this worked. So I guess the problem lies somewhere with the generated node.

Is there some magical thing involved I need to do in order to be able to show a node inside a fancybox pop-up?

Comments

j.somers’s picture

I want to mention I solved it by creating my own Fancybox module which allows me to create several selectors and adds the required selectors via inline javascript. It suits my needs better and seems to work so far.

janton’s picture

Yes i wanted to do exact te same thing.. so i guess it's not possible with this fancybox module to show a iframe or node content with a class iframe or fancylink.

Somers, did you upload the code somewhere or do you want to share it?