Recent Changes - Search:

Cookbook

PmWiki

pmwiki.org

AddLinkBookmarklet

Summary: How to use PmWiki to bookmark pages
Version: 12 February 2006
Prerequisites:
Status:
Maintainer: Nils Knappmeier
Categories: Links

Question

How can I easily use PmWiki to bookmark pages I find on the web?

Answer

The addlink.phpΔ script provides a bookmarkable link (a "bookmarklet") that you can put in your browser to quickly add links to wiki pages as you surf the web.

addlink2.phpΔ is an improved version of the script, which asks the user for link-text before adding the link to the target page. If a link text is entered (into a java-script prompt-box), it will create a real link of the form [[link text -> url]]. The server-side code is compatible with bookmarks of version 1.
addlink2.0.1.phpΔ
I did a little update so that everyone can have the following options:
# Add links to the bottom instead of the top?
SDV($EnableAddLinkToEnd,0);

# What text should be added immediate before and after each new link?
# The default is a newline before and after.
SDV($AddLinkPrefixText,"\n");
SDV($AddLinkSuffixText,"\n");

Just incase you want new links to be prefixed with "**NEW!!!**", for instance. I was thinking about adding a feature for sending new links to a specific anchor if anyone is interested in that. Let me know. MikeShanley

Description

PmWiki is an excellent tool for maintaining lists of links on the web, but there are too many steps (find the page, copy the URL of the page you wish to save, open the wiki page to edit, paste the URL into the wiki page, hit save).

With the addlink.php script, you can simply click on a link (bookmarked within your browser) to quickly add the URL of the currently viewed page into a wiki page.

Installation

1. Copy the addlink2.0.1.phpΔ script into your cookbook/ directory, then add the following line into your config.php file:

    include_once("$FarmD/cookbook/addlink2.0.1.php");

2. Browse to the wiki page on which you would like to save links, and place the markup (:addlink:) into that page.

3. The (:addlink:) markup will become a link that says +=pagename . Bookmark that link in your browser.

4. Now, you can surf the web, and when you find something you want to save in the wiki page, click the bookmark page. You'll instantly be transported to the wiki page with the (:addlink:) markup in it, and the URL of the page you were viewing is automatically added at the top and ready for you to annotate or edit.

Discussion/Comments/Feedback

The page Test.AddLinkBookmarklet has this recipe enabled if you wish to try it out.

Note that once you've bookmarked the link created by (:addlink:), it's okay to remove or comment out the (:addlink:) markup in the page of links (the bookmark in the browser will still function).

I created a version of the AddLinkBookmarklet to work with the Kind-ofBlog and Tags recipes. kob-addlinkΔ works the same as the above Bookmarklet (you have to put (:addlink:) someplace to create the links to the bookmarklets), but then the bookmarklets adds a blog entry for the page you're visiting, includes the selected text, prompts for tags, and adds a link to the page. If no text is selected, it prompts for that too. See instructions in the header of the kob-addlink.php file for installation instructions. Andy Kaplan-Myrth May 31, 2006, at 02:34 PM

How is this related to being a "Bookmarklet"? As far as I can tell it is for storing links on a PMWiki page instead of your browser. Perhaps you might change the name to something more mnemonic? Perhaps you could educate me on this. Someone might confuse this with recipe Bookmarklet GNUZoo 08 21 2006 1:00 am CST.

Since this recipe predates yours, maybe you should have noticed. Anyway, now that you have noticed, why don't you be diplomatic and think about a new name for yours before you go suggesting to others that their name is the one that should change. Personally, I prefer having this recipe retain its name.
Because names are supposed to be mnemonic. GNUZoo 08 21 2006 6:45 pm CST.
AddLinkBookmarklet is precisely the right name for this recipe. I wanted to search for this functionality and the first term that came to mind was "bookmarklet." (This is what del.icio.us, for instance, calls its own buttons to save links.) matt September 03, 2008, at 12:23 PM

See Also

History

7.8.2007
2.0.1 update available.
some time
...
12.2.2006
Support for entering a link name in a dialog box (addlink2.phpΔ)Nils Knappmeier
8.3.2006
Bugfix (addslashes before HandleEdit) Nils Knappmeier
21.3.2006
Bugfix (ugly workaround that sets $action='edit' in order for the EditForm to be loaded correctly. (addlink2.php only)

Contributors

  • Nils Knappmeier -- original concept
  • MikeShanley -- a few more improvements
  • Christian Ridderström -- improvements to original concept
  • Pm -- conversion for PmWiki 2 (2004-11-30)
User notes?: If you use, used or reviewed this recipe, you can add your name. The following format is recognized:
* (+) Optional positive comment. Name, date
* (-) Optional negative comment. Name, date

These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.

Edit - History - Print - Recent Changes - Search
Page last modified on February 15, 2010, at 05:19 AM