[pmwiki-users] bookmarklet on wiki page

JB jbit at ev1.net
Thu Aug 17 22:39:51 CDT 2006

Ben Wilson wrote:
> Look at these recipes. Both produce bookmarklet markup, and should
> help guide you to your answer. If this is overwhelming, let us know,
> and I'll see if I can provide a better answer. :-)
> http://www.pmwiki.org/wiki/Cookbook/Marklets
> http://www.pmwiki.org/wiki/Cookbook/AddLinkBookmarklet
> http://www.pmwiki.org/wiki/Cookbook/Bookmarklet


You need to pay attention.  I have already responded to this.
In case you did not notice, the first two recipes do nothing like
I asked.  And the third one is one that I created yesterday!

Below is a repeat of my response to this.


I chatted with PM today on irc and he provided a great solution.

First, PM said it is not wise to allow "javascript:blahblahblah" 
inside of a PMWiki page source because that would be a security risk.  
Currently PMWiki just appends it to the end of the current page url.  
I thought maybe it might behave like an external URL and not be 
modified at all. I could not find any way to do this and that is 
why I chatted with PM.

The solution:
Put this in you local config.php

# allow action bookmarklet links
$LinkFunctions['action:'] = 'LinkIMap';
$IMap['action:'] = '$1';
$IMapLinkFmt['action:'] = "<a

Then your pmwiki page source code can look like this:


And now you have bookmarklets!  You can drag the link
from your browser window to your bookmarks or to you
bookmarks toolbar.  I prefer the bookmarks toolbar
because it makes it into a button for you.

So whenever you are in a pmwiki you are just 1 click 
away from actions.  This is useful if you have a 
wiki that you want to look like a web page without the 
"View Edit History Print" in the upper right.  To 
edit you can click the browser bookmark toolbar button
(bookmarklet).  This will save you from having to click
in the URL box and typing ?action=edit to the end of the 
url and then pressing enter.  A big ergonomic improvement.

Thanks PM!   :)


More information about the pmwiki-users mailing list