Subscribe to our feed

Symfony Experts

Symfony Experts
If you have an urgent question for a symfony-related issue, this is the place to ask.


Stack Overflow

The old fashioned way


August 16, 2007 – 5:09pm New symfony plugin: sfLightWindowPlugin

We’re pleased to announce the release of our latest symfony plugin, sfLightWindowPlugin. sfLightWindowPlugin provides great helper functions for LightWindow v2.0. LightWindow is a great improvement over the original Lightbox 2 script, and includes handlers for virtually all media types, including flash, quicktime, youtube videos, images, remote content, inline content, and more. Using this plugin, it’s amazingly simple to add these great effects to your symfony site.

Check out the sfLightWindowPlugin Demo for a closer look. You won’t be disappointed!

To download the sfLightWindowPlugin, visit the wiki page for download and installation instructions.

Posted by in  Web Development   |  

23 Responses to New symfony plugin: sfLightWindowPlugin

  1. Eric Bartels says:


    nice work! But you have a slash too much in the url of your demo so an error 404 is generated by symfony …
    ( ->


  2. Scott Meves says:

    Thanks Eric, I didn’t catch that!

  3. Thierry says:

    Hey, good to see the plugins progressing a long. The list is becoming longer and longer.

  4. Pingback: » A week of symfony #33 (13->19 August 2007)

  5. amrin says:

    I have implement lightwindow using sflightwindow on my project. but after I put the link to show an action

    it’s display nothing, only loading…

    please, anyone help me?

  6. amrin says:

    I have found that sflightwidow will conflict with

    visual_effect(‘appear’, ‘post_comment’, array(‘duration’ => 0.5)

    so be careful if you use ajax visual effect on your template. please choose the effect that not used by your lightwindow

  7. Celso says:

    How do i fix the problem amrin commented?


  8. Celso says:

    how do i use flash paper?

  9. Jeff L says:

    I found that with lw_image I can point to an image via relative address (e.g. ‘/sfLightWindowPlugin/gallery/0.jpg’). But with lw_button, to point to an image, I have to use full address (e.g. ‘http://project/sfLightWindowPlugin/gallery/0.jpg’), otherwise symfony will redirect to 404. Is this a bug?

  10. JoostDJ says:

    Thanks for this really nice plugin! 🙂

    Only 1 problem: When I try to submit a form in a LightWindow using your plugin I get the following error in Firebug:

    $(form).getElementsByTagName is not a function
    getElements(false)prototype.js (line 2656)
    serialize(false, undefined)prototype.js (line 2652)
    _lwSingleFormCall(click clientX=0, clientY=0)lightwindow.js (line 1951)
    submitForm(click clientX=0, clientY=0)lightwindow.js (line 360)
    bindAsEventListener(click clientX=0, clientY=0)

    I’m using the latest versions of (1.8.0) and ProtoType (1.6.0).

    Is this a know issue??

  11. frustrated says:

    great plugin, documentation is a bit vague though

  12. Scott Meves says:

    What kind of extra help are you looking for? Everything that you can do is demonstrated on the sfLightWindowPlugin page. Install the plugin, follow the first few examples and you’ll be off the races.

  13. Symbiat says:

    Do you have any sample code showing how to load an FLV player and movie file into a LightWindow?

  14. Scott Meves says:


    check out the demo page ( All you have to do is set the ‘src’ attribute to the .swf file.

  15. Symbiat says:

    Yes, Ive read through the template. Im playing an FLV file. My template contains a partial that contains this:

    getThumbnail(), array(‘width’ => 144, ‘style’ => ‘border:2px solid #fff’)), ‘@playvideo?id=’ . $item->getId(), array(‘title’ => ‘Video: ‘ . $item->getTitle())); ?>

    When I click the link, the lightwindow loads a template that contains this:

    <embed src=”/flvplayer.swf” width=”getWidth(); ?>” height=”getHeight(); ?>” type=”application/x-shockwave-flash” pluginspage=”” wmode=”
    opaque” flashvars=”file=getUrl(); ?>&displayheight=getHeight(); ?>&displaywidth=getWidth(); ?>&autostart=true” />

    var so = new SWFObject(‘/flvplayer.swf’,’player’,’getWidth(); ?>’,’getHeight(); ?>’,’7′);
    so.addVariable(“file”,”getUrl(); ?>”);
    so.addVariable(“image”,”getThumbnail(); ?>”);
    so.addVariable(“width”, “getWidth(); ?>”);
    so.addVariable(“autostart”, “false”);
    so.addVariable(“height”, “getHeight(); ?>”);

    The problem is the video appears to start playing before the loading has finished but then it starts playing again a second later after it has finished loading. Im just trying to figure out why that happens.

  16. Scott Meves says:

    Interesting. I’m not sure exactly what is happening, although I can see a problem with this:

    <embed src="/flvplayer.swf" width="getWidth(); ?>" height="getHeight(); ?>" type="application/x-shockwave-flash" pluginspage="" wmode="
    opaque" flashvars="file=getUrl(); ?>&displayheight=getHeight(); ?>&displaywidth=getWidth(); ?>&autostart=true" />

    I’m not sure if this is something with the comment filtering on this blog or if your embed src really does have a width set like this: width=”getWidth(); ?>” . That’s no good! Make sure you are passing the parameters into the helper properly, it looks like in this case it’s not parsing the PHP and instead is actually putting the function text “getWidth(); ?>” inside the width parameter….

  17. Symbiat says:

    Hmm… I took out the EMBED tag inside the “player” DIV and all I see now is a blank lightwindow. So it looks like JavaScript is not running inside the LightWindow. I vaguely remember reading about scripting being switched off by default in symfony helpers so maybe that’s it? Does this ring any bells?

  18. Scott Meves says:

    I don’t think it’s related to javascript. You might want to try and get the videos working without the symfony helpers and just do it the way Kevin does by hand ( That way at least you can rule out any issues with the symfony plugin.

  19. Symbiat says:

    The player loads and plays normally if I load the play action page in my browser directly. If I load the same page into LightWindow I get an empty (blank) window.

  20. MG-Programmer says:

    Did you solved your Problem? I’ve got the same one. In LightWindow it just appears a blank window and if I load the page normally it works fine…

  21. Carl Edwards says:

    I have a page where I click on a lw_link button that pops up a lightwindow. This has several buttons and links in it and currently you click an option then click a “continue” button.

    Clicking the selected option runs a javascript function in the original window that sets a hidden form variable. I now want to change the page so that I only have to click on the option in the lightwindow and it calls the javascript function and then closes the lightwindow. I am finding this impossible to do! If I have “rel=deactivate” and “class=lightwindow_action” in the option link in the lightwindow, all that happens is the lightwindow is closed, the a href=”javascript:myfunction();” never actually fires!

    I’ve tried doing “mylightwindow.deactivate()” in the javascript function I call and it just says “mylightwindow is not defined”. I’ve tried doing “lightwindow.deactivate()” and it says that is not a function…

    I’m lost! Surely this is possible to do?

  22. Vanessa says:

    Hey how would I use a flash video (flv) instead of the swf?


  23. af4ng says:

    I’m a newbie in symfony. I just installed the sfLightWindowPlugin and it worked successfully when i click a link (using lw_link). My problem is that i want to show the lightwindow when my textbox lostfocus (onBlur). The action is it will refer to ‘module/action’. Same like lw_link. But i can’t using lw_link inside the input_tag. Can you suggest me what i have to do?

    Thanks a lot.