This is a port of the original demo used with LightWindow v2.0. If you look at the source you will see it uses the symfony helpers to do all the work. It's amazingly simple to add these great effects to your site.
Changes from original LightWindow v2.0 The sfLightWindowPlugin uses a slightly altered lightwindow.js source. The only changes made were to the path of the image files, and the option of using an improved inline form handler, found in the last two methods _lwUpdateWithResponse and _lwSingleFormCall.
Requirements LightWindow v2.0 requires at least prototype 1.5.1.1 and scriptaculous > v1.7.1. These are included with the plugin, but you can customize the location of this files in sfLightWindowPlugin/config/config.php.
Notes Due to the size of some of the sample content, it is best that your browser window is larger than 800px for these demos.
It's easy to use, and supports all the page and media types of LightWindow. After installing the plugin, just include the helper in your template file and you are off to the races.
<?php use_helper('LightWindow') ?>
<?php echo lw_link('My LightWindow', 'module/action') ?>
<?php echo lw_media('My Media File', '/gallery/my_movie.mov', 'width=19 height=240') ?>
<?php echo lw_image(image_tag('pic_thumb.jpg'), '/gallery/pic.jpg') ?>
<?php echo lw_button('click to open!', '/images/yourimage.png', array(
'title' => "Great Pic",
'author' => "Stereo",
'caption' => "Your caption",
'left' => 300,
)) ?>
You can also add any of the the following options in the third parameter:
title // title of window
author // author of window
caption // the caption for the window
width // Width of window
height // Height of window
show_images // Number of images to show at once in a gallery
top // Set as an Integer to be spaced from the Top
left // Set as an Integer to be spaced from the Left
type // Specify the type of content served: page, external, image, media, inline
loading_animation // Set to false to opt to not fade out the Loading Cover
iframe_embed // To embed media into a media into an iframe rather than just into a div
form // The name of the form
To create a gallery, you use the lw_gallery() function with an array of image attributes.
<?php
$media = array();
$media[] = array(
'link' => '<strong>Image Gallery</strong> - Everyone needs a killer gallery!',
'src' => '/sfLightWindowPlugin/gallery/0.jpg',
'options' => array(
'class' => 'page-options',
'title' => 'High 5 Dood!',
'caption'=> 'Snow people know how to have fun...',
),
);
$media[] = array(
'link' => 'Header #3',
'src' => '/sfLightWindowPlugin/gallery/header3.swf?scale=noscale&tag1=Sooth Your Mind & Body&tag2=Justice Through Integrity&tag3=Helping Injured Victims&tag4=Experience You Can Trust',
'options' => array(
'width' => '769',
'height'=> '209',
'title' => "Oh My! Flash and Images Mixed!",
'author'=> false,
'caption'=> false,
),
);
$gallery_options = array(
'hide' => true,
'title' => 'default title',
'caption' => 'default caption',
'author' => 'Unknown',
);
echo lw_gallery($media, 'Random[Sample Images]', $gallery_options);
?>
View the PHP source of this page found in /sfLightWindowPlugin/modules/sfLightWindowPlugin/templates/indexSuccess.php to find out more about galleries of images and other types of web media.
Quicktime Movie Example - Local File Apple.com Trailer - Transformers, more than meets the eye! Single SWF Example - Because I Love Flash... SWF Gallery - Any media can now be used in a GALLERY! SWF #2 User Example - CheathamLane.net Flash Paper - The RIGHT way to embed a PDF! You Tube - 300 Preview
Website Example - Preview any website from yours! NEW Page Treated as External - This page is local to this domain but is placed in an iframe.
Textual Link Links can be text or images...
NEW External Image - An Image pulled from an External Source
Image Gallery - Everyone needs a killer gallery!
image #1
Header #3
Image Gallery w/Multiple Images - Side by Sides can be good for Before and After Gallery's or to show actions, etc.!
Image 1
Image 2
Image 3
Image 4
Image 5
or
NEW A link with no Class - As in no Class Name! We built this one with a function call.
Form Example - Submit a form in a lightWindow! NEW Form Example with a custom position - Submit a form in a lightWindow!
Fluid Page - This page does not have a width, the content is flexible. Fixed Page - This page has a defined amount of space it needs or it will cause a horizontal scroll. Monster Fixed Page - This page is just plain too big for the browser window unless you maximize a 30 inch monitor. Set Dimensions - Set the dimensions of the window.
Inline Content - Not a fan of AJAX? No worries, here you go.
Oh yeah, this content was pulled from within the page!
In order to get the LightWindow to fit the content, you have to define the height and width of a div in the inline div or send values for lightwindow_width and lightwindow_height in the url string. Personally I prefer the inner div method, this way you can gracefully degrade the link as I did into an anchor if javascript isn't available.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Vestibulum hendrerit nibh at libero. Donec lectus enim, condimentum ac, scelerisque non, malesuada id, diam. Sed porta magna. Ut luctus bibendum nulla. Ut sit amet tellus. Aliquam ut justo. Duis sapien magna, sagittis et, molestie at, interdum a, mi. Nunc nisi arcu, tincidunt quis, adipiscing ac, faucibus convallis, ligula. Aenean lacinia laoreet nisi. Integer dictum. Maecenas porttitor dictum felis.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Vestibulum hendrerit nibh at libero. Donec lectus enim, condimentum ac, scelerisque non, malesuada id, diam. Sed porta magna. Ut luctus bibendum nulla. Ut sit amet tellus. Aliquam ut justo. Duis sapien magna, sagittis et, molestie at, interdum a, mi. Nunc nisi arcu, tincidunt quis, adipiscing ac, faucibus convallis, ligula. Aenean lacinia laoreet nisi. Integer dictum. Maecenas porttitor dictum felis.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Vestibulum hendrerit nibh at libero. Donec lectus enim, condimentum ac, scelerisque non, malesuada id, diam. Sed porta magna. Ut luctus bibendum nulla. Ut sit amet tellus. Aliquam ut justo. Duis sapien magna, sagittis et, molestie at, interdum a, mi. Nunc nisi arcu, tincidunt quis, adipiscing ac, faucibus convallis, ligula. Aenean lacinia laoreet nisi. Integer dictum. Maecenas porttitor dictum felis.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Vestibulum hendrerit nibh at libero. Donec lectus enim, condimentum ac, scelerisque non, malesuada id, diam. Sed porta magna. Ut luctus bibendum nulla. Ut sit amet tellus. Aliquam ut justo. Duis sapien magna, sagittis et, molestie at, interdum a, mi. Nunc nisi arcu, tincidunt quis, adipiscing ac, faucibus convallis, ligula. Aenean lacinia laoreet nisi. Integer dictum. Maecenas porttitor dictum felis.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Vestibulum hendrerit nibh at libero. Donec lectus enim, condimentum ac, scelerisque non, malesuada id, diam. Sed porta magna. Ut luctus bibendum nulla. Ut sit amet tellus. Aliquam ut justo. Duis sapien magna, sagittis et, molestie at, interdum a, mi. Nunc nisi arcu, tincidunt quis, adipiscing ac, faucibus convallis, ligula. Aenean lacinia laoreet nisi. Integer dictum. Maecenas porttitor dictum felis.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Vestibulum hendrerit nibh at libero. Donec lectus enim, condimentum ac, scelerisque non, malesuada id, diam. Sed porta magna. Ut luctus bibendum nulla. Ut sit amet tellus. Aliquam ut justo. Duis sapien magna, sagittis et, molestie at, interdum a, mi. Nunc nisi arcu, tincidunt quis, adipiscing ac, faucibus convallis, ligula. Aenean lacinia laoreet nisi. Integer dictum. Maecenas porttitor dictum felis.