Note: The recipes here are for PmWiki versions 0.6 and 1.0 only. For PmWiki 2.0 recipes, see Cookbook.


I have a page filled with thumbnail links to larger images. When I click on a thumbnail, the image usually opens in my window, and I lose the wiki skin in my browser. To retain the skin, I have to create a page for each image, with the larger image displayed inline. This means ceating a LARGE number of pages.

I would like to have a single page for the larger image (call it LargeImage), and have all thumbnail links point to the LargeImage page. Then, when I click on a thumbnail, the LargeImage page would get displayed, with the appropriate image displayed inline.


First, define the gallery: intermap link (in local/localmap.txt) with:


Next, add the following to your local/config.php:

 $DoubleBrackets['{$Img}'] = $_REQUEST['img'];

Finally, in the LargeImage page, put the following markup where you want the passed-in image to be displayed.{$Img}

In any wiki page you can put the markup:

 [[gallery:photo.jpg /path/to/thumbnail]]

to create a thumbnail that will open in the LargeImage page.


In the above example, gallery:photo.jpg becomes a link to
i.e., it jumps to the LargeImage page and has the desired image passed in the img= parameter.

Inside of LargeImage, the sequence is replaced by the value of the img= parameter, so the markup{$Img}

which is then converted to an inline image in the LargeImage page.


There is a working example at the following page:

Click on any thumbnail, they all open in the same LargeImage page.

See Also

  • PictureGallery -- Display uploaded pictures and automatically create thumbnails for preview
  • X-Gallery -- include an Image Gallery in your Wiki pages
  • EmbeddedGallery -- How to embed the Menalto Gallery inside of PmWiki

Comments & Bugs

Initially the recipe didn't work (no image displayed inline) until I added the intermap link in /scripts/intermap.txt instead of local/localmap.txt.
If you have to resort to this, don't forget to backup your scripts/intermap.txt for it will be overwritten as soon as you upgrade.

Once in the LargeImage page, if you click on the title link the page gets reloaded without any image displayed inline, which can be annoying. Therefore, I've put a [[notitle]] keyword in the LargeImage page to hide the title link.


pmwiki-2.3.7 -- Last modified by {{Ugo}}

from IP: ip should be disabled by default for security reasons