bas Lightbox
by Bastian Sackermann
This plugin brings the Lightbox JS by Lokesh Dhakar to textpattern.
Lightbox JS is a simple, unobtrusive script used to to overlay images on the current page.
Lightbox uses Prototype by Sam Stephenson and Scriptaculous by Thomas Fuchs.
Installation
Before you can use this plugin, you have to run the advanced install at extension -> bas Lightbox.
The script imports all files and images you need for lightboxing from samisdat.org.
You can skip the automatic import and download the files as bas_lightbox.zip and upload the manual.
Use the txp image-managment for images and file-managment for files. Don`t rename the files.
If you want to use a custom-field to refer the image category, just rename an custom-field to Lightbox.
You can rename custom-field at admin -> advanced preferences
Localisation
The default language of bas Lighbox is English, but there are some translations.
For every supported language there is an additional plugin:
Download the language plugin, install and activate it.
bas Lightbox will use this language plugin, if you active this language at admin -> manage language.
Plugin Perferences
After you run the advanced install, you can save some plugin preferences.
The saved prefs are used as default values and can be overwritten by including the attribute intag plugin’s tag.
Usage
Please <txp:bas_lightbox_head /> into your sites head, this tag will add all script and css to your site.
The lightbox scripts are 124 kB big, so include it only to sections where you want to use it.
Usage in article’s body or excerpt or in article-form
Include <txp:bas_lightbox /> to an article, you can include it to body and/or excerpt.
You can refer the images within the tag by atrributes img or cat
<txp:bas_lightbox img="2,3,7"/>
<txp:bas_lightbox cat="a-cat"/>
Or you include just include <txp:bas_lightbox /> into article and refer images:
- Comma seperated in article’s image field
- Rename a custom-field to Lightbox. This custom-field will be replaced by a drop-down list of all image categories. Select a cat from this list.
Usage in page or forms
You can include <txp:bas_lightbox /> into page, too.
For example place it into your sirebar and show your thumbs there.
In page there is only a indirect way to refer the images:
<txp:bas_lightbox use_section="true"/> This will show all thumbs from the category with the very same name as the actual section. For example, if you want to show some images at section “about”, add all these images to img-cat “about”. Remember that section’s name and section’s itle must be the same.
<txp:bas_lightbox use_cat="true"/> This will show all thumbs from the category with the very same name as the actual category.
Plugins Attributes
You can customise the plugin by including attributes to tag, you can edit the default values at extension -> bas Lightbox
<txp:bas_lightbox caption="name|alt|caption" /> Use caption to define what text is displayed in the Lightbox. Choose from name, alt or caption
<txp:bas_lightbox label="My pics" labeltag="h2" /> Define a label
<txp:bas_lightbox wraptag="ul" break="li" />
<txp:bas_lightbox wraptag="ul" wrapclass="thumblist" break="li" breakclass="img" /> Asign classes to wraptag and break to style them by CSS.
|