Home
Add the bookmark this link to a Web page
To simplify the process of adding a bookmark to one's bookmark collection in Lotus Connections, the product provides a Bookmark this button that users can add to their toolbar and can click to add the current Web page to their collection. You can add similar functionality to your Web application by adding a Bookmark this link to a page. When a person clicks the link, the Web page is added to the user's Lotus Connections bookmark collection.
The Bookmarks feature provides the following resources to help you create the Bookmark this link:
- JavaScriptâ„¢ library: A single file named doglink.js that defines a JavaScript object named "DogLink" and contains a post_to_dogear() method. The file is available from the following Web address: http://{your_bookmarks_server}/dogear/tools/doglink.js
- Icon resource: A file named favicon.gif that is located at the following Web address: http://{your_bookmarks_server}/dogear/misc/favicon.gif
The post_to_dogear() method is invoked when a user clicks the Bookmark this link. It opens a separate Web browser window in which the user can modify the description or other fields, and then save the bookmark to her collection in the Bookmarks feature.
To add the Bookmark this link to your Web page...
- Include the JavaScript library in the <head> HTML block of your Web page. For example, use the following HTML element, replacing "www.example.com/dogear" with the address of your Bookmarks server:
<script type="text/javascript" src="http://www.example.com/dogear/tools/doglink.js"/>
- In the Web page, at the location in which you want the Bookmark this link to be displayed, add an onClick event that calls the following method:
post_to_dogear(url, title, tags, description)
post_to_dogear() method parameters
Parameter Description description Description of the page. You can leave the field blank. If your pages have a <meta> tag for descriptions, you can use JavaScript code to get it and fill the field. tags Tags are labels that people can associate with a page to categorize it. You can leave this parameter blank or include default tags that you want people to use. Enter tags as a single word, separated by commas or spaces. title Title of the page. Specify document.title to refer to the title of the current page. url Web address of the page. Specify location.href to refer to the current page. For example:
<a href="#" style="text-decoration:none;" onclick="DogLink.post_to_dogear(location.href,document.title,'',''); return false;"> Bookmark this! </a>
- Recommended: Include a bookmark icon that is displayed on the page in front of the Bookmark this link text.
<a href="#" style="text-decoration:none;" onclick="DogLink.post_to_dogear(location.href, document.title, '', ''); return false;"> <img height=16 src="http://www.example.com/dogear/misc/favicon.gif" width=16 border=0> Bookmark this! </a>
Replace www.example.com with the address of your Bookmarks server.
Example
Example:<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Sample Bookmark-able Web Page</title> <script type="text/javascript" src="http://www.example.com/dogear/tools/doglink.js"> </script> </head> <body> <h2>A sample web page with a bookmark link</h2> <p>Your content here. </p> <a href="#" style="text-decoration:none;" onclick="javascript:DogLink.post_to_dogear(location.href, document.title, 'tag1,tag2 tag3', ''); return false;"> <img height=16 src="http://www.example.com/dogear/misc/favicon.gif" width=16 border=0/> Bookmark this! </a> </body> </html>