|
SinglePageGallery<< Embedded Gallery | Cookbook-V1 | >> Note: The recipes here are for PmWiki versions 0.6 and 1.0 only. For PmWiki 2.0 recipes, see Cookbook.
GoalI 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. SolutionFirst, define the gallery: intermap link (in local/localmap.txt) with: gallery http://www.example.com/pmwiki.php/Group/LargeImage?img=$1 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. http://www.example.com/path/to/images/{$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. DiscussionIn the above example, gallery:photo.jpg becomes a link to Inside of LargeImage, the sequence is replaced by the
value of the img= parameter, so the markup which is then converted to an inline image in the LargeImage page. ExampleThere is a working example at the following page: http://www.shyitalia.com/shy.php/English/Photos Click on any thumbnail, they all open in the same LargeImage page. See Also
Comments & BugsInitially the recipe didn't work (no image displayed inline) until I added the intermap link in /scripts/intermap.txt instead of local/localmap.txt. 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 Contributorspmwiki-2.2.38 -- Last modified by {{Ugo}}
|