[Pmwiki-users] PmWikiDraw New version
Knut Alboldt
pmwiki
Thu Nov 4 14:30:50 CST 2004
Ciaran wrote:
>8) URLS: On my local dev version Wiki Pages are in fact correctly
>referenced as I insert a <BASE> tag which is honoured by the ImageMap.
> However I don't want to go 'live' with this solution as its nasty and
>could break pages. Your suggestion of another 'Template variable' is
>good, I may well do this ;) If the user puts in a relative url I'll
>automatically pre-pend it with %WIKIPAGE% or something
what I thougt is this:
when I use the pmwiki-syntax for variables within the URL's i specify
within the drawing (using the URL-button in the applet) then reading the
mapfile in the PmWikiDraw-script could translate the mapfile simply using
the FmtPageName()-function. so you could replace the statement
$contents = str_replace("%BUILDEDITLINK%", $editImageUrl, $contents);
by
$contents = FmtPageName($contents,$pagename)
and add $editImageUrl to the global-list of the function
example-map:
<map name="draw01" id="draw01 ">
<area shape="rect" coords="68,77,225,155"
href="{$ScriptUrl}/MyGroup.MyPage" alt="MyGroup.MyPage" />
<area shape="rect" coords="0,0,405,5" href="{$editImageUrl}" alt="Click to
edit the image" title="Click to edit the image" />
...
</map>
so both $ScriptUrl and $editImageUrl will be substituted well.
And even better: if you like other variables tomorrow, you only have to add
them in the applet in the know syntax ( {$Varname} ) and make them global.
It reduces the syntax to variable substitution to one (the pmwiki-variable
in pagetext) format.
Anyway, lot's of theory. I think I'll work a bit with pmwikidraw and try to
make some changes to the script for testing. If there are some solutions
I'll send you the changes for demonstration and review and if you like it
you can take it over into the distribution in the cookbook.
Knut
More information about the pmwiki-users
mailing list