|
Cookbook /
ImageMapSummary: Directive to create image maps and image toolbars
Status: Stable
Version: 2006-10-28
Prerequisites: pmwiki-2.0
Maintainer:
Categories: Images
Download: imagemap.phpΔ
Questions answered by this recipe
AnswerThe script imagemap.phpΔ adds markup to define image maps from within the wiki page. Download imagemap.phpΔ and copy to the cookbook directory, install by adding to config.php: include_once("Syntax
It does not matter where on the page the imgmap markup is written, it does not produce any output by itself, only via the associated image. Each
Further optional parameters:
If any areas defined overlap each other then the area on top should come before the area underneath. If the image as a whole is defined as default area with shape=default it should come last, just before the Example
NotesConflict with LineBreaks: If you configured your wiki to honour line breaks (new lines) then you need to put before the Releases
CommentsI just applied this recipe to two imagemaps in my wiki which previously were HTML attachments to wiki pages, and after a smooth conversion I'm very happy with the results. Thank you, HansB! :-) --Henning February 23, 2006, at 11:40 AM Hi HansB, one of my collegues was wanting to link within a page using an imagemap, but the current code places a '#' and not the tag for a link within a page. I played with the php code and replaced:
// preg_match("/(#)(.*?)/e",$tgt,$m); ## old - pre hack
// if($m[1]) $LinkUrl = '#'; ## old - pre hack
with: if (preg_match("/^#/",$tgt)) { # special hack for Aya
$LinkUrl = $tgt; # special hack for Aya
} # special hack for Aya
@] This works for me, but you may wish to solve it another way, of course... I add some code for link to a email (beginning with mailto: , it seems to work for me !
preg_match("/(mailto:)(.*?)/e",$tgt,$m);
if($m[1]) $LinkUrl = $tgt;
Style Attribute SupportHi, I added following code to the MapArea-function allowing one to set a style. --Martin November 08, 2006, at 23:57 PM
if (isset($arg['style']))
$out .= " style='".$arg['style']."'";
Relative Page NamesI've modified the href code a bit to allow for relative pagename links. For example, if the current page is House.Kitchen, href=Bathroom resolves to House.Bathroom. Additionally, I tightened up the RegExs. Here's the patch against version 2006-10-28: imagemap.php-relative_href_patch.txtΔ --DanZD November 13, 2006, at 14:49 PST See AlsoContributors |
||||||||||||||||