Adding Bookmarks
September 25th, 2008

This script is used to allow your visitors to bookmark your site. It is capable of opening the browser’s save bookmark dialog window for Internet Explorer 5+, Firefox 2+, Netscape 8+, and Opera 7+. Other bookmarking scripts usually only open only the dialog window for IE and displaying a reminder message for other browsers.

Download addbookmark.zip (addbookmark.zip)

Download the zipped file and extract the addbookmark.js file, then upload it to your site. To access the script on your page, enter the following code in a custom header:

<script type="text/javascript" src="addbookmark.js"></script>

If you upload the script to a directory other than the root, make sure you include the path with script’s file name.

The script contains two functions, one for a text link and one for an image link. You can use either one or both on the same page. No matter which link type you want to use, a code object is used as the link holder, so place an empty code object on your work page and make note of its geometry name. This name will be used by the script function.

With the code object placed on your page, you now need to specify which function (or both, if desired) will be used. This is done by adding the following code into your custom header:

<script type="text/javascript">
  addBookmark(function(){textLink("Ggeometry-name","bookmark-text");});
</script>
<script type="text/javascript">
  addBookmark(function(){imageLink("Ggeometry-name","image-filename");});
</script>

where:

geometry-name The geometry name of the code box (do not forget the prefixed "G")
bookmark-text The text you want displayed for the text link (if omitted, "Bookmark this page" is displayed)
image-filename The filename of the image to be used as the image link, including the necessary folder path information

Examples:

 

 

The text link is displayed using the default font set on the Page Editor→Links,Fonts tab. If you want to change the font appearance within the code object, you can use CSS style codes to modify its contents to achieve the desired format. For example. to produce the following bookmark link:

 

enter the following CSS style codes in the custom header:

<style type="text/css">
#Ggeo-name {
  font: italic 8pt times,sans;
}
</style>

where geo-name is the code object’s geometry name prefixed by a capital G. Refer to CSS references about the font tag for your available options.


One Response to “Adding Bookmarks”

    cadman33619 says:

    Hi,
    having a little trouble adding the bookmark option to my page. I’v followed the instruction but I’m not sure what I’m doing wrong. I placed the addbookmark.js file in the folder where all the files for the web page are saved but it will not work.

    I’m also using the Date & Time script. I got that one to work ok…but it looks like i have to leave the header name for that one selected in the page editor in order for it to work. If i leave another header name selected and close the page editor, then the date and time script will not work.

    What am I doing wrong?

    Thanks
    cadman33619

    http://WWW.k2engineering.com

Leave a Reply

Spam protection by WP Captcha-Free


May 20th, 2012