sfJQueryLightboxPlugin - 1.1.1

JQuery image lightbox effect.

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to the Plugins Home

Signin


Forgot your password?
Create an account

Tools

Stats

advanced search
Information Readme Releases Changelog Contribute
Show source

sfJQueryLightBoxPlugin

Description

This helper transfomrs image link into fully featured lightbox effect. Automatically creates gallery.

This plugin uses awesome jQuery library and jQueryLightBox plugin by Leandro Vieira Pinho.

Try out demonstration

Installation

$ symfony plugin:install sfJQueryLightBoxPlugin
$ symfony cache:clear

Requirements

This plugin requires JqueryReloadedPlugin.

Usage

Place jQuery helper in your layout (or settings.yml):

<?php use_helper("jQuery") ?>

And place JQueryLightbox helper somewhere inside your body tag

<?php use_helper("sfJQueryLightbox") ?>

In template place light_image() function for every image you want to have lightbox effect:

<?php echo light_image($thumbnail_url, $full_image_url, array('title' => $image_title )); ?>

Customizations

Function light_image() have following syntax:

light_image($thumb_url, $image_url, $image_link_options = array(), $thumb_options = array() )

Where:

  • $thumb_url : thumbnail url
  • $image_url : full image url
  • $image_link_options : additional html attributes to add to image link (e.g.: array ('title' => 'My image'))
  • $thumb_options : additional html attributes to add to thumb image tag (e.g.: array ('border' => 5))

In your app.yml file you can customize images used for displaying next, prev, close butons and text 'Image X of X':

all:
  sf_jquery_lightbox:
    css_dir: '/sfJQueryLightboxPlugin/css/'
    js_dir:  '/sfJQueryLightboxPlugin/js/'
    imageLoading: '/sfJQueryLightboxPlugin/images/lightbox-ico-loading.gif'
    imageBtnClose: '/sfJQueryLightboxPlugin/images/lightbox-btn-close.gif'
    imageBtnPrev: '/sfJQueryLightboxPlugin/images/lightbox-btn-prev.gif'
    imageBtnNext: '/sfJQueryLightboxPlugin/images/lightbox-btn-next.gif'
    imageBlank: '/sfJQueryLightboxPlugin/images/lightbox-blank.gif'
    txtImage: 'Image'
    txtOf: 'of'