Questions answered by this recipe
- How do I create bookmarklet links on a PMWiki page.
- I made my PMWiki site look like a web page without the "View Edit History Print" in the upper right. Is there an easier way to edit than typing "?action=edit" at the end of every URL?
It is really useful to place an EDIT button on your toolbar using a bookmarklet. Especially when you have wiki(s) that do not have edit links and look like non-wiki websites. I find that the EDIT button is the most convenient and useful bookmarklet.
You can drag a bookmarklet link from your browser window to your bookmarks or to your bookmarks toolbar. I prefer the bookmarks toolbar because it makes it into a button for you.
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. For instance, drag the bookmarklet link "edit" to the browser bookmark toolbar to create an Edit button. To edit a PMWiki page you can now just click the button. 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.
So whenever you are in a pmwiki that is more like a web page you are just 1 click away from actions.
- Do not confuse this recipe with the OtherBookmarklets or the AddLinkBookmarklet recipes. This recipe creates a bookmarklet link on a displayed PMWiki page. OtherBookmarklets only displays the code necessary to create a bookmarklet in your browser, but does not create a link on you PMWiki page. AddLinkBookmarklet uses a PMWiki page to keep links, I seen no relationship to this "Bookmarklet" recipe except for name.
- This recipe is secure because it only allows authors to reference bookmarklets which are predefined in your config.php or farmconfig.php file.
A working example of bookmarklets can be found at this link: Bookmarklet Example
New feature - Included are some new bookmarklet favicons for some PMWiki actions.
Bookmarklets in FireFox are not required to have name text if they have a icon (favicon). If you are happy with just an icon you can remove the name text. To do this first you must add an icon to your bookmarklet. You can install them easily using the freeware utility AM-DeadLink. Then right-click the bookmarklet and select properties from the popup context menu. Then clear the text in the "name" field and click the "OK" button.
How To Use
There are 2 solutions here. The first one is for ALL PMWiki actions. The second one is for ONE individual bookmarklet. They both work with a wiki farm.
Installing for all actions
In your config.php enter:
or in your farmconfig.php enter:
In you PMWiki page put code like this:
[[action:browse|View]] [[action:edit|Edit]] [[action:diff|History]] [[action:upload|Upload]] [[action:crypt|Crypt]] [[action:print|Print]] [[action:search|Search]] [[action:source|Source]] [[action:login|Login]] [[action:logout|Logout]] [[action:rss|RSS]] [[action:atom|Atom]] [[action:rdf|RDF]] [[action:dc|DC]] [[action:refcount|RefCount]] [[action:ruleset|Ruleset]] [[action:phpinfo|PHPInfo]] [[action:diag|Diag]] [[action:attr|Attributes]]
Installing for a single bookmarklet link.
Working example of bookmarklets can be found at this link:
This program is free software. You can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation http://www.fsf.org either version 2 of the License, or (at your option) any later version.
Copyright 2007 by GNUZoo email: guru [snail] gnuzoo [period] org
Please donate to the author at url: http://gnuzoo.org/GNUZooPayPal
- 1.2 cleaner code, executes only for specific actions
- 1.1 Added RecipeInfo, made into an includeable script
- Initial Release
- Dynamic Page Actions an alternative approach to provide "clean" pages for visitors, but action links for logged in editors.
- AddLinkBookmarklet uses a PMWiki page to keep links, I see no relationship to this "Bookmarklet" recipe except for name.
See discussion at Bookmarklet-Talk