Many of us work on multiple computers and use PmWiki to track essential information. However, we still need a way to quickly and easily manage bookmarks. Marklets improves the similar approach in Cookbook:AddLinkBookmarklet by giving the user two ways to add categorical bookmarks to a wiki site---manual mode and "hurry mode," and by providing a mechanism to remove unwanted bookmarks. The impact is an easy-to-use bookmark management system accessible whenever you are on the Internet. This should help you track the sites that are important to you.
Phase One: Server Preparation.
- Download Attach:marklets-0.9.2.phpΔ to your web server and place in the
- Add the script to your
include_once("$FarmC/marklets-0-9.php");(where $FarmC is the path-to-cookbook).
- Via the browser, add the
(:marklet-codelets:)markup to pages where you want bookmarks added. I created a group "Bookmarks" and added the markup to
Bookmarks/GroupFooter. Then, to create categories, I would create a page "
Bookmarks/Bookmarks-Technical." With the page name, it is important that categories are hyphen delimited (e.g.
Bookmarks-Technical). I will explain this in greater detail below.
- Verify the marklet markup works. Look at the page where you added the markup. You should see two links, one of which has a "hurry mode."
Phase Two: Client Preparation.
- I use the bookmark toolbar, so I will show this approach.
- Add a Folder (right-clicking the toolbar) to the bookmark toolbar. I named my folder "Marklets"
- Visit the page on your wiki where you want your marklet to save the bookmarks.
- Add a Bookmark (right-clicking the new folder) to the bookmark toolbar.
- Give it a name, I like to use the category.
- Copy the link location for the "hurry mode" link.
- Save the snippet to the Bookmark location.
- Repeat for each "hurry" bookmark.
After adding the "hurry" marklets, let's add a normal marklet.
- Go to the group's main page (e.g.
- Add a Bookmark to the Marklet folder
- Give it a pithy name like "Manual Marklet"
- Copy the link location for the non-hurry mode link.
- Save the snippet to the Bookmark location.
There are two ways to add a bookmark: manually and "hurry." We will now explore each in turn. There are two terms worth mentioning here to reduce confusion. First, the "focused" web page is the page you are viewing and of which you want to create a bookmark. The "targeted" web page is the bookmark category page you where you want the bookmark to be added. In both methods below, the date the marklet was added will be timestamped.
Adding Manual Marklets. To create a bookmark manually, visit the page you want bookmarked. Assuming you've followed the phases above, you will have a "Manual Marklet" in a "Marklet" folder on the Mozilla bookmark toolbar. Click open the Folder, then click the "Manual Marklet" bookmark. This will grab the focused page's address and title, and feed this information to a form on your PmWiki site.
The form has a few fields that we should discuss briefly. As mentioned above, the title and address are pre-loaded, but you can edit them. There is also a "description" field that allows you to provide a terse description of the site. There is also a "category" pulldown list and a "add category" field. The "category" pulldown contains the category pages (e.g.
Bookmarks-Productivity become Technical and Productivity categories, respectively). So, if you want to add the link to an already-existing page, select the respective category. However, if you want to create a new page, then you will add the category name (e.g. Business, which will become
Bookmarks-Business) in the "add category" field. This field preempts any selected category in the pulldown, so leave this field blank if you want to add to an existing category. Submit the form, which creates the marklet. The browser window will display the targeted page when the marklet is added.
Adding Hurry Marklets. This is a lot easier. While on the focused web page, open the marklet bookmark as discussed above (e.g. Bookmark-Technical, which is the "targeted" page). This will grab the web page's address and title, and automatically create a link on the targeted page. The browser window will display the targeted page when the marklet is added.
Deleting Marklets. Deleting marklets should be intuitive, but I will briefly mention it here. When looking at the PmWiki category page, click the "Delete" link. This link only appears when the user is logged into the system and has the ability to edit the page.
Categories. This system provides categories to help the user
organize his bookmarks. The page category follows the hyphen (-). For
example, links on the
Bookmarks.Bookmarks-Example page belong to the
"Example" category. This is site-customizeable, using the
Some administrators may prefer to have the category be an integral part
of the page name, such as
Bookmarks.BookmarksExample for the Example
category. To use this category structure, set
".Bookmarks"---the leading period is important.
Alternatively, a site administrator may prefer the category name be the page name itself. For example,
Bookmarks.Example for "Example," or even
Bookmarks.BookmarksExample for "BookmarksExample." Set
$MarkletSplitPoint to '\.' to use this structure.
Finally, in an effor to empower the site administator, the
$MarkletCategories variable provides a configurable list of
categories. This can either be a static array. There is also the
$MarkletCategoriesFunction, which allows the site-administrator to
create a function to create a dynamic list instead of the default
- This is the bookmark link text.
- By default, this recipe adds new bookmarks to the top of the list. By setting this variable to a non-zero value, the bookmarks will be appended to the bottom of the list.
- Provides a configurable list of categories. This can either be a static array, or the array-based output of a site-administrator function.
- allows the site-administrator to create a function to create a dynamic list instead of the default behavior. Default value is the default category-generating formula.
- This is the date format appended to the end of a bookmark link. Default format is '[-[%b %e, %Y (%I:%M %p)]-]';
- This varable allows the site administrator to change the default delete link text from 'Delete.'
- (Default: %red% (duplicate)) Allows the site administrator to alter the duplicate link indicator. If this value is set to '', then the indicators will disappear. This does not affect links created prior to 0.9.2.
- The default behavior of this recipe is as described above---when the bookmark is added, the browser remains on the targeted page. By enabling this variable (i.e. set to a non-zero value), then the
- When redirecting is enabled, this variable sets the time the targetted page is displayed before returning to the focused page. Default is 4 seconds;
- The default behavior of this recipe is to create categories by using a hyphen (-). This variable allows site administrators to alter this behavior, as explained in the "Categories" paragraph in the "Managing Bookmarks" sub-section above.
- v.0.9 - August 2, 2006 BenWilson Initial public release.
- v.0.9.1 - August 3, 2006 BenWilson Public reaction.
- Bug: Fixed problem with delete tag code.
- Bug: Fixed non-functioning $MarkletAddTextToEnd behavior.
- Feature: Delete appears only when user can edit the page.
- Feature: Added $MarkletSplitPoint functionality.
- v.0.9.2 - August 3, 2006 (PM) BenWilson Public reaction, round two.
- Bug: Fixed dup bug.
- Feature: $MarkletCategories, which allows a static list of categories.
- Feature: $MarkletCategoriesFunction, which allows site-admin to code
own dynamic routine for listing categories.
- Feature: Duplicate warning configurable ($MarkletDuplicateMark).
- Feature: Duplicate warning toggleable.
Please discuss any questions, comments or issues on this recipe's Cookbook:Marklets-Talk page.
- BenWilson original author.