DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:prettyphoto

This is an old revision of the document!


prettyphoto Plugin

Compatible with DokuWiki

  • 2024-02-06 "Kaos" unknown
  • 2023-04-04 "Jack Jackrum" unknown
  • 2022-07-31 "Igor" unknown
  • 2020-07-29 "Hogfather" yes

plugin Adds prettyPhoto support for images

Last updated on
2013-05-29
Provides
Render
Repository
Source

The plugin will automatically create prettyPhoto popup links for all images that are embedded as direct links.

You can find a simple showcase at http://sysfault.org/dokuwiki/projects:dwpretty FIXME

Installation

Search and install the plugin using the Extension Manager. Refer to Plugins on how to install plugins manually.

Examples/Usage

The default configuration of the plugin will provide a overlay box for images that are linked directly into the page:

{{fancyimage.jpg?direct&100|}}

The plugin is comes with an own renderer that automatically replaces internal image media links, which refer to the details page of the images, with direct links to the images. This is a convenience mechanism to save you typing “?direct” for each and every image link. See images for further details about image links.

Using '?direct' as image parameter will cause the plugin to create lightbox-like overlays.

{{:projects:pumpkins.jpg?direct&100|}}
{{:projects:cupcakes_shelf.jpg?direct&100|}}

'?nolink' will not cause the plugin to create any overlay. The default behaviour is preserved.

{{:projects:pumpkins.jpg?nolink&100|}}
{{:projects:cupcakes_shelf.jpg?nolink&100|}}

'?linkonly' will not cause the plugin to create any overlay. The default behaviour is preserved.

{{:projects:pumpkins.jpg?linkonly&100|}}
{{:projects:cupcakes_shelf.jpg?linkonly&100|}}

If you do not want to rework all your image links, you can also enable the custom renderer that ships with the plugin. It will pick all images that do not use the 'nolink' or 'linkonly' parameter and create an overlay.

{{:projects:pumpkins.jpg?100|}}
{{:projects:cupcakes_shelf.jpg?100|}}

Customization

The main magic happens within script.js, which will pull in a configuration file prettyphoto.conf.js, located in DokuWiki's conf/ folder. Two javascript variables will be tested within the configuration file,

var PRETTYPHOTO_PLUGIN_MEDIAPATH

which defines the media item link for the DokuWiki installation. By default, DokuWiki uses lib/exe/fetch.php?media=, your installation however might use different links, changed by rewrite rules. If this is the case, you should set

var PRETTYPHOTO_PLUGIN_MEDIAPATH = "<your media path>";

within prettyphoto.conf.js. To customize the behaviour of the prettyPhoto overlay, you can use

var PRETTYPHOTO_PLUGIN_PARAMS

which contains the prettyPhoto configuration to be used (see the prettyPhoto documentation for further details on customizing), e.g.

var PRETTYPHOTO_PLUGIN_PARAMS = { social_tools: '' };

for disabling social media integration.

Development

Change Log

Check the commit log.

Known Bugs and Issues

Please post any bugs or issues on the bug tracker

Feature requests

Please post feature requests on the bug tracker


:!: Doesn't work with Dokuwiki rewrite mode. FIXME

What execatly does not work? If you're using .htaccess rewriting, just tweak the paths in the .conf.js file.
Having trouble to get the renderer to work with hrun - had a running installation, copied all content, installed prettyphoto afterwards through plugin manager. using htaccess rewrite and no gallery pluginin. the photo gets no lightbox but is opened alone in the tab –~~
I can confirm that Dokuwiki rewrite crashes this plugin. A working fix ist ready to be pulled, but it seems the author is not updating any more. So you have to merge/update manually with the files from this pull-request-link.
The prettyPhoto v.3.1.6 had released on May 7, 2015 which covers a XSS Fix. There is a fork of “PrettyPhoto Plugin for DokuWiki” that includes updated prettyPhoto v3.1.6 and a patch I sent as PR around 2014 (Auto detection of PRETTYPHOTO_PLUGIN_MEDIAPATH based on $conf['userewrite'] setting). it works with DokuWiki Release 2015-08-10a “Detritus”. — s.sahara 2015-10-15 14:27
plugin/prettyphoto.1596987256.txt.gz · Last modified: 2020-08-09 17:34 by hillschmidt

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki