Add a “Post to Diigo” button to your site

Diigo

If you are like me, you use a social bookmarking tool to keep track of all the links you come across that you would like to revisit later or share with someone. I love social bookmarking tools for their easy of use, and the ability to tag my bookmarks and sort by tags or lists. Here at Vivid Matter we use both Delicious and Diigo to keep track of our bookmarks and sync bookmark lists between the team. This works great for us, and as such we want to share these awesome tools with our clients to help make their sites more user-friendly. For a recent site build we ran into a roadblock when we went to add the ability to save blog posts to your Diigo bookmarks: Diigo does not provide any code examples for adding a “Post to Diigo” button on your website. This blew our minds! How could you not have that feature on your site, that functionality seemed too basic to overlook. After a fairly exhaustive search on the topic we felt it was up to us to pioneer that functionality. The result is the following:

<a href="#" onclick="window.open('https://www.diigo.com/post?url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title), '_blank', 'menubar=no,height=580,width=608,toolbar=no'); return false;">
<img src="https://lh4.ggpht.com/PaV4x6Q92xFbKHOyS-FpZ7jzWDdAWrnhOAb0d8t_SODgsXWHhO8PNCvLkQWU-k3vwPQO=w50" height="16" width="16" alt="Diigo"> Post to Diigo
</a>

The code above will add a “Post to Diigo” link to the page that opens a new pop-up window with the “Add a Bookmark” screen in your Diigo account open. The code above also pulls the Diigo icon directly from the Diigo site so you do not have to spend time creating your own icon. Unfortunately there are a few minor caveats, which we will explain. First; the Diigo site does not appear to be responsive, so the menu and footer extend beyond the viewport border, but the main content fits fine in the window. The other minor consideration we noted was that you need to be logged into your Diigo account, this is expected behavior seeing as how Diigo needs to know which account to save the bookmark to.

We would love to hear your thoughts, are there any other social bookmarking tools you use? Hit us up in the comments section below to join in on the discussion.

Written by Jesse Goll

Jesse G, grew up working on computers. He fondly remembers playing space invaders on a Tandy II. Jesse has over 12 years experience working in the industry on everything from single page brochure sites to multi-million dollar enterprise level sites. When not buried deep in the latest programming book. Jesse G enjoys fishing, camping, hiking, mountain biking, hunting, and spending time with his wife and twin daughters.

Website: http://www.vividmatter.com