Gallery2:Modules:simpleviewersource - Gallery Codex
Personal tools

Gallery2:Modules:simpleviewersource

From Gallery Codex

Simpleviewersource Module

Description

a basic interface to allow Simpleviewer (http://www.airtightinteractive.com/simpleviewer/) to load its pictures from a Gallery2 installation. Simpleviewersource is a small module that produces the xml output that simpleviewer uses, and provides an interface to download an item according to permissions.

There are two basic modes of operation: to use the Simpleviewer application within your own website but displaying pictures stored within Gallery - or - to offer Gallery visitors the opportunity to use Simpleviewer within the Gallery environment.

To use the first mode, you can install Simpleviewer anywhere in your own website, and follow the instructions below for how to configure it to show contents of the album of your choice.

To use the second mode, you must install the Simpleviewer code in a new directory called "xml_slideshow" in your Gallery's lib/directory. So the path to the swfobject.js file should look like ".../lib/xml_slideshow/swfobject.js". Then make sure to enable the Offer Slideshow setting in the module's Admin page.

Installation

  • First, download and install the Simpleviwer product from Airtight Interactive, and get it operational on your website inside the web-pages from which you want it to be visible.
  • If you want to use this module's built-in 'slideshow' menu item in Gallery albums then you must unpack the Simpleviewer plugin files in a new directory called 'xml_slideshow' inside your Gallery's /lib/ directory. So the path to the swfobject.js file should look like ".../lib/xml_slideshow/swfobject.js".
  • Download the module from the Plugins -> Get More Plugins page of your gallery installation. The module is in the community repository. Please note: the Gallery simpleviewersource module doesn't include the actual Simpleviewer code which is copyright, subject to licence conditions, and has to be obtained from the Airtight Interactive website, and installed by you, separately.
  • Configure, then Activate it. There are no configuration options - configuration adds a minimal set of parameters to the root album, from whose Edit Item page they can be changed.
  • Enter the Simpleviewer parameters for each album (and its children) in the tab under Edit Album.

Usage

The module allows Gallery to source the XML data for Simpleviewer such that the images are served back from the Gallery installation.

All parameters are set in the Simpleviewer Tab of the Edit Album page. They include the basic options as shown, as well as a per-album limit on the number of files to download, and an enable/disable switch. All options carry through to sub albums, and override settings higher up. Custom options can also be set; enter the name as well as the value in the boxes at the bottom of the page. If custom options are set in any other albums, you will see the names offered to you as a convenience.

To direct Simpleviewer towards the Gallery installation follow the instructions on this page for customizing the XML data source: http://www.airtightinteractive.com/simpleviewer/customize.html

Use syntax as in the following example:

fo.addVariable("xmlDataPath", "http://www.myGalleryWebsite.com/main.php?g2_view=simpleviewersource.XMLOut%26g2_itemId=xxxx");


The correct path to use for each album is displayed in the Simpleviewer tab of the edit album page, where the parameters are set.

Thumbnails are drawn from Gallery's thumbnails; "main" images are sourced as the smallest resize (or original or thumbnail) that is as large as or larger than the maxImageHeight/maxImageWidth parameters active for that album, and for which view permission is available at the time the image is downloaded by Simpleviewer. If no maxImageHeight/maxImageWidth is set for the album or its parents, then the largest available image is used. If your browser's permissions change during the downloading (you log in to the Gallery as Administrator, for instance) the size of image downloaded can change from one image to the next across the gallery. The images are also cached by the browser, so you may need to empty the cache before you see the 'correct' image for your permissions.

Bug reports, questions, comments, suggestions etc in this thread please: http://galleryproject.org/node/67310

Requested Features

  • Build a theme around simpleviewer, using this module as the core to display the images
  • Configure a background image, also served from Gallery
  • Translations

To do list

Carbon theme customization: http://galleryproject.org/node/84786#comment-297354

Bugs

  • bug go here
  • and here
advertisements