User Tools

Site Tools


doc:plugins:photoswipe

PhotoSwipe

This FlatPress plugin displays single images and whole image galleries with the JavaScript library PhotoSwipe which provides a very appealing fullscreen display of the images. And on mobile devices such as tablets or smartphone you can browse through the images by swipe gestures.

Since the plugin uses FlatPress default functionality for building the image HTML, you may use the documented parameters of the [img] tag such as “alt”, “title”, “height”, “width” or “float” (see FlatPress BBCode documentation for details).

Author: Arvid Zimmermann

Usage

For a single image:

[photoswipeimage="images/image.jpg"]

Floating image with given width:

[photoswipeimage="images/image.jpg" width="200" float="right"]

For an image gallery:

[photoswipegallery="images/NameOfTheGallery"]

Gallery width given image height:

[photoswipegallery="images/NameOfTheGallery" height="100"]

Multiple Usage

If the plugin is called a number of times on a page, all images referenced, whether as single images or as part of a gallery, will be displayed in a single gallery.

HTML+CSS

The HTML code of the images is generated by the BBCode standard function do_bbcode_img() (see fp-plugins/bbcode/plugin.bbcode.php). Therefore, standard image attributes (such as “width”, “height”, etc.) can be used. Floating images will get a corresponding CSS class (e.g. “floatright”). The plugin will wrap that HTML in a <figure> element with the same CSS class as the image (e.g. “floatright”). The <figure> also contains a <figcaption> displaying the title of the image. The <figure> element itself is surrounded by a <div class=“photoswipe”>.

Galleries are displayed as a series of images as described above, encapsulated by a <div class=“img-gallery”>.

Captions

Captions of the gallery images will be read from a text file “texte.conf” within the gallery directory. For having the title attribute in the gallery images (and therfore, also see it as description below the images in the gallery), just create a file “texte.conf” within the gallery directory. If you have the gallery images 1.jpg, 2.jpg and someother.jpg, your texte.conf should look like this:

1.jpg = Description of the first image
2.jpg = This is the second image.
someother.jpg = OMG, another image!

For now, you have to create the texte.conf files for each gallery manually via FTP.

From FlatPress 1.3 on, the plugin “Gallery Captions” provides a convenient way write captions for gallery images in the FlatPress Admin Area.

How to remove the captions

If you don't want to display captions at all, this is the easiest way to get rid of them: Just add the following to the CSS of your theme!

div.img-gallery figcaption { display:none; }

Download

photoswipe1.0.6.zip if FlatPress ≤ 1.2.1

doc/plugins/photoswipe.txt · Last modified: 2024/04/07 22:37 by fraenkiman

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki