Questions answered by this recipe
How can I easily add pre-marked-up links to wiki pages using a bookmarklet.
Add links to wiki pages using a bookmarklet.
Unpack the archive in your cookbook directory and add this to your configuration file (e.g. config.php):
Configuration is optional. There are four settings.
- Bookmark the link, then go to a page and click the bookmark.
- Optionally you can highlight some text in the page before clicking the bookmark.
This recipe creates an "add link" bookmarklet that makes it easy save web site links in your wiki. It works like this:
- Insert (:addlink:) in a page.
- Add the link as a bookmark in your browser.
- Optionally delete the (:addlink:) markup from the page.
- Surf the web and find a page you want to bookmark.
- Highlight some descriptive text in the page.
- Use the bookmark.
Your browser will be taken to your site in edit mode. By default the page's title will become a definition term and the text you highlighted will become the definition for the term. A bookmark for pmwiki.org has markup that looks like this
and renders like this
Optionally you can have the recipe create "heading style" (a.k.a. Herber style) markup that looks like this
and renders like this
This is a fork of an old version of the AddLinkBookmarklet recipe, which at the time seemed unmaintained and overlooked. At this point it's significantly different from the original.
Despite the name, this is a stand-alone script. Other recipes from CMS Bundle are not required.
Change log / Release notes
- 2015-11-06 - The browser sniffing now smells newer browsers. Also now escaping the vertical-bar character in URLs.
- 2016-09-16: Some cleanup + added a setting so the link text and the link title (tooltip) are separate settings ($AddLinkText and $AddLinkTitle respectively). Moved README text to a separate file and bundled as an archive you can unpack from the cookbook/ directory.
- 2017-01-30: PHP 5.5+ bug fixed.
- Nils Knappmeier - Original AddLinkBookmarklet author
- Pm- Contributed to the original script
- HaganFox - Created a "CMS Bundle" version
- NeilHerber - Donned his programmer's hat and provided helpful feedback and advice