[pmwiki-users] Costom markup for gallery page

Patrick R. Michaud pmichaud at pobox.com
Sun Mar 27 13:04:17 CST 2005


On Sun, Mar 27, 2005 at 07:49:09PM +0200, Ugo Mariani wrote:
> I'm using pmwiki 1.0.8 and I would like to create a custom markup, but 
> after a few days searching, I realized mt php skills aren't up to it. 
> This is what I would like to do:
> [...]
> 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.
> [...]
> This is as far as I've got. I've searched the list, found some information on 
> DoubleBrackets and on how to pass arguments, but I couldn't get anything to 
> work, and I'm stuck.

Hmm, this would probably be a *lot* easier in PmWiki 2.0.  But here's
a shot at a 1.x implementation:

First, 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}


Okay, let's see what happens.  In any wiki page you can put
the markup:

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

gallery:photo.jpg becomes a link to 
http://www.example.com/pmwiki.php/Group/LargeImage?img=photo.jpg -- 
i.e., it jumps to the LargeImage page and has the desired image 
passed in the img= parameter.

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

   http://www.example.com/path/to/images/{$Img}

becomes

   http://www.example.com/path/to/images/photo.jpg

which is then converted to an inline image in the LargeImage page,
which I think is what you wanted.

How's that?

Pm



More information about the pmwiki-users mailing list