SocialBookmarkIcons

Summary: Create dynamically a list of clickable icons for social bookmarking sites.
Version: 2007-03-08
Prerequisites: PmWiki-2.1.27
Status: Stable
Maintainer: JonHaupt
Categories: Includes Images

Questions answered by this recipe

This section is optional; use it to indicate the types of questions (if any) this recipe is intended to answer. How can I include a list of social bookmark icons that, when clicked, post my page to social bookmarking sites like del.icio.us, Ma.gnolia, Furl, and the like?

Description

Create dynamically a list of clickable icons for social bookmarking sites in PmWiki.

social-bookmark-icons.zipΔ

In order to accomplish this, three steps are needed: First, enable the wiki engine to build the right kinds of urls (i.e. valid ones) that include the title and whatnot from your post. Second, create a generic page that can be included on any page thus making sure you don't have to keep typing the urls. Third, style the icons so they look good.

Included in social.bookmark-icons.zip are the following:

  social-bookmark-icons.zip
    /social-bookmark-icons
      social-bookmark-icons.php
      social-bookmark-icons.css
      /wikilib.d
        Site.SocialBookmarkIcons
      /uploads
        /Site
          (various image files)

Place the /social-bookmark-icons folder in your /cookbook folder. Place the /uploads/Site files in your /uploads folder, place the css file in your /pub/css folder, and enable the recipe in config.php by using

  include_once("$FarmD/cookbook/social-bookmark-icons/social-bookmark-icons.php");

When you want to include the icons for a given page, simply use

  (:include Site.SocialBookmarkIcons:)

Additionally, the recipe enables the (:urlencode whatever:) markup which will encode any text or page variable in such a way that it will be a valid url.

If you want to use these in a pagelist, you need to change them around, because (:urlencode {*$Titlespaced}:), for example, won't work -- you would need (:urlencode {=$Titlespaced}:).

Notes

In order to show only one or a few social bookmark icons, the Site.SocialBookmarkIcons page can be altered, or you could create a different page with fewer icons. Or, you could just copy the markup for the one icon you need.

Release Notes

If the recipe has multiple releases, then release notes can be placed here. Note that it's often easier for people to work with "release dates" instead of "version numbers".

2007-03-08: Released.

Comments

Some of this buttons doesn't work. I think they need an update. An other way to use SocialBookmarking is to generate widgets and include it on your WebSite. I've found some providers for free: www.clearspring.com, www.addthis.com. Look at Enable HTML and Java Script how to use (Security). st January 12, 2009, at 10:34 AM

Mark 13/03/07

Got an error and then realised that I had to make a directory in cookbook called 'social-bookmark-icons'. So if you get the same either make a directory or edit the include_once.

Works a charma nd very nice. Thanks Mark

Thanks, Mark. I uploaded a new version that already has a folder called /social-bookmark-icons that can simply be placed in the cookbook folder and updated the directions. - JonHaupt

See Also

Contributors

yes

User notes? : If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.