Easy social bookmarks

version 1.0.0



Live demo

Here is what your list will look like 'out of the box' - i.e. with only the default page style applied





Installation

The install process consists of 3 steps detailed below.

File edits

Open bookmarks.js
Make sure to only make edits between the start/edit comments


Variables to be edited

html_before
var html_before = ' ';

The content of this variable is added before every bookmark. By default this is a space however could be changed to the start of a list item:

var html_before = '<li>';

Or left as is.



html_after
var html_after = '&nbsp;';

The content of this variable is added after every bookmark. By default this is a space however could be changed to the end of a list item:

var html_after = '</li>';

Or left as is.



imagepath
var imagepath = '/images/';

This is the path, relative or absolute, to the location of the bookmark icons. A trailing slash should be present. Setting this to zero will disable icons from being shown on the bookmark list

var imagepath = '0';

Make your edits as you wish, save and close bookmarks.js



Uploads

Upload bookmarks.js to a location on your server - where you wish

Upload the images in the icons folder (or the whole icons folder) to a location on your server.
Remember: The imagepath variable needs to the point to the location of the uploaded icons



Adding to pages

The last step of installation is to add the bookmarks to any pages you wish.
Firstly add the bookmarks.js into the page by using this HTML code:

<script type="text/javascript" src="path/to/bookmarks.js"></script>

Be sure to make sure the src attribute points to where you uploaded the file in the previous step.

Last step is to add the following HTML where you want the list of bookmarks to be displayed:

<script type="text/javascript">
<!--
swgbookmarks();
//-->
</script>

Save all the files and upload!



Adding bookmarks

As of version 1.0 the script includes, by default, 6 bookmarks:

However more can be added

Warning: This section of installation is entirely optional and is only recommended for advanced users

Extra bookmarks can be added to the bookmark list section in bookmarks.js using this syntax:

sites[x] = new Array(Bookmark URL, Bookmark name, Icon URL);

x is an integer which increases with the number of items in the bookmarks array as demonstrated by the default array in the file

Bookmark URL is the direct URL to add the bookmark. Not the URL of the bookmark website! This URL will have to be found out from the website.
The bookmark URL will have to contain the URL of the page being bookmarked - use {url} to insert the current page URL into the bookmark URL. Use {title} to insert the current page title into the bookmark URL. Example:

http://www.bookmarksite.com/add-bookmark?url={url}&title={title}

Bookmark name is the name of the bookmarking website/service which will be shown next to the icon

Icon URL is the URL to an image (usually around 16x16 pixels) to represent the service. The imagepath variable can be used or the URL could be absolute



Help and support

You can get help, support for this script plus other web design and development tips from our webmaster forums: http://community.spyka.co.uk/forumdisplay.php?f=9


advertisement

Support

Need help, support or advice using or install our scripts? Take a look at our webmaster forums

Donate

Like our scripts? Consider a donation