You are here: Home Plone products Products.pipbox

Products.pipbox (1.0)

by Olha Pelishok last modified 2010-08-17
Released on 2010-08-10 by Steve McMahon for Plone 3.0 under GPL - GNU General Public License available for All platforms.
Software development stage: beta
Picture In Picture (lightbox/greybox) support for Plone

PIP = Picture in Picture

pipbox = picture boxes in Plone

Products.pipbox provides JQuery Tools support in Plone. This allows lightbox-style popups that may be loaded as images, AJAX html, or iframes.

The goal is that this support will be available via methods that wrap the Javascript implementation (currently JQuery Tools) so that it can change if necessary.

Site setup for pipbox is table-driven, with settings in the table allowing you to specify DOM elements via jquery selectors. These are usually going to be <a href... /> or <img src... /> elements. You specify how the URL should be loaded (as an image, ajax or iframe). You may also optionally supply a regular expression search/replace pair for the URL and additional arguments for the JS engine. Options are specified with JSON object notation. I anticipate that this will become GS profile driven.

Let's say, for example, that you want to make clicking on news-item photos open a lightbox-style larger version of the image. To do this, you'll need to specify:

  • A jquery style selector for a Plone element, e.g., ".newsImageContainer a"
  • "image" for the load method ("ajax" and "iframe" are other alternatives)
  • A regular expression search/replace to transform the href or src URL. In this example, we're changing the URL to point to the preview-sized image. So, our search/replace pair is "/image_view_fullscreen" and "_preview".
  • You could also specify additional overlay configuration parameters.

Site setup for pipbox is table-driven, with a lines field in portal_properties.pipbox_properties. In this table, each line is a specification, with the elements of the specification separated by "|" characters. So, all of the above will need to be a line like:

{type:'overlay',subtype:'image',selector:'.newsImageContainer a',urlmatch:'/image_view_fullscreen$',urlreplace:'_preview'}

Another quick example, one that provides full-image popups for images placed via kupu:


What's different? We're targeting <img ... /> tags, which don't have href attributes.
pipbox picks up the target URL from the src attribute, so that we can have a popup view
of image elements that aren't linked to that view. Note also that we're using a real
regular expression in the search/replace so that we can strip off image_preview, image_mini,

And, a configuration to put the site map in an iframe popup with expose settings, picking up the target from an href:

{type:'overlay',subtype:'iframe',selector:'#siteaction-sitemap a',config:{expose:{color:'#00f'}}}

Document Actions
Powered by Plone