is there a way to assign the title field and/or a cck image field of a post so that when it's clicked, instead of going to the full node page, a thickbox/lightbox pops up and displays a flash movie (by using a .flv url that's been entered in a cck field)?

Comments

markusH’s picture

Well, I guess it can be done through theming. I used contemplate to achieve this. I can't go into details here but I paste the code that works for me.

Basically you have to theme the thickbox manually for teaser/full page view. The details I kept learning from http://jquery.com/demo/thickbox/

Maybe this is a point to start.

<?php 

$ge_swf_thumb =  base_path() .  "files/imagecache/basic_thumbnail/" . $node->field_video_thumbnail[0]['filepath'] ;

$ge_swf_videothumb = "image=imagecache/video_player_size/" . $node->field_video_thumbnail[0]['filepath'] ; 

?>

<div id="ge-video-thickbox-<?php print $node->nid ?>" class="ge-video-thickbox" style="display: none;">
  <?php print swf( substr($node->field_video_file[0]['filepath'],6), SWFDEFAULT, ""); ?>
</div>

<div class="field field-type-image field-field-video-thumbnail">
  <div class="field-items">
      <div class="field-item">
   <a href="#TB_inline?height=340&amp;width=400&amp;inlineId=ge-video-thickbox-<?php print $node->nid ?>" 
      class="thickbox" 
      rel="bild" 
      title="<?php print check_plain($node->field_video_beschreibung[0]['value']) ?>" >
    <img src="<?php print $ge_swf_thumb ?>" 
         alt="<?php print check_plain($node->title) ?>" 
         title="<?php print check_plain($node->title) ?>" />
   </a>
   </div>
  </div>
</div>
Stuart Greenfield’s picture

Status: Active » Closed (fixed)

Setting to closed - no follow up posts in over six months, and a possible solution was posted.

Please post again or re-open if required.

luco’s picture

any chance this might work with Lightbox2? and without needing snippets of code?

cheers,
Luciano

AlexanderPop’s picture

for drupal 6 ? SWF Tools 6

Stuart Greenfield’s picture

Status: Closed (fixed) » Active

This is going to be in 6.x-3.x and I think you'll like the simplicity!

As a result of fixing a support request in #757232: Open 1pixelout in new window I had a eureka moment. As a result of the new SWF Tools cache system to improve performance it's created an incredibly simple way to do this.

I've tested locally with the LightBox2 module, and all you need to pop some flash up in a lightbox is something like:

$output = swf('someContent.swf', array('othervars' => array('return_cid' => TRUE)));

print '<p><a href="/swftools/page/' . $output . '" rel="lightframe[flash|width:220px; height:220px;]">Open in LightBox</a></p>';

And that's it - movie in a lightbox!

The syntax above with the othervars stuff is "indicative" at the moment as I'm putting the code together properly right now, but that is pretty much all there is to it!

Stuart Greenfield’s picture

The solution in #757232: Open 1pixelout in new window is working well, but this doesn't let you create lightboxes via CCK.

The bit I'm struggling with for CCK is that we need to know the content, we need to call swf(), and then we need to write a link, but what do we write? Text? An image?

With CCK I'm not sure this will be that easy to do as there are too many bits to configure. But with a little bit of PHP to implement the code above it's easy.

But if someone can think of a good way to do this via CCK I'm open to suggestions!

Yuki’s picture

subscribe

jaarong’s picture

subscribed

nicoloconte’s picture

Is it working also with rtmp streaming? I'm using this code but is not working:

$output = swf('mp4:tagliato.mp4',
          array(
            'flashvars' => array('type' => 'rtmp'),
            'othervars' => array('return_cid' => TRUE, 'stream' => 'rtmp://195.130.xxx.xxx:1935/video'),
          )
        );

print '<p><a href="/swftools/page/' . $output . '" rel="lightframe[flash|width:220px; height:220px;]">Open in LightBox</a></p>';
</p>
Stuart Greenfield’s picture

I've not tested it, but it should work, as the generated code is simply a player.

Have you tested the syntax in a non-lightbox node first to check the basic syntax is right and that SWF Tools is actually rendering a valid player?

Streaming can be a little tricky to get just right so it may be best to test the code in a simple setting first, and then render it in lightbox.

nicoloconte’s picture

@Stuart Greenfield

in a non-lightbox node is working perfectly :) , the lightbox still doesn't work.

ron williams’s picture

Status: Active » Closed (won't fix)

5.x-1.x is no longer supported, so I have marked as closed.