PDA

View Full Version : Bookmark ( Add to favourites) button in BV



navaldesign
10-31-2006, 06:23 PM
This is an example of bookmark button. A BV advanced button is used.
Please copy the following code in the "Between Head" Tag of your page HTML:


<script type="text/javascript">
/***********************************************
* Bookmark site script- &#169; Dynamic Drive DHTML code library (www.dynamicdrive.com (http://www.dynamicdrive.com/))
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/
function bookmarksite(title, url){
if (document.all)
window.external.AddFavorite(url, title);
else if (window.sidebar)
window.sidebar.addPanel(title, url, "")
}

</script>

To create the button, open your BV page, and click on the icon of the "Advanved Button" , or clicl on "Insert", --> Form --> Advanved Button. Size it as you want, and double click on it , to open the Properties Dialog Box.


For the button properties, select the following:
Button Type: OnClick
OnClick Action : Execute Javascript function
In the OnClick value field type in javascript:bookmarksite('site_title', 'site_URL')
Replace "site_title" with the actual title of your site, f.e. 'Studio Navaldesign'.
Replace 'site_URL' with the actual URL of your site (or that of the specific page), f.e. 'http://www.navaldesign.info'

Please test the script in www.navaldesign.info/Tips/bookmarkbutton.html (http://www.navaldesign.info/Tips/bookmarkbutton.html)

This script was found, as you can see, in Dynamic Drive at http://www.dynamicdrive.com (http://www.dynamicdrive.com/)

Oh, it also works in preview.

naghosthunter
11-14-2006, 11:22 PM
or this hehe...

<a href="javascript:window.external.AddFavorite('http://www.yourwebsite.com', name of website)" style="font-size:12px;color:#0033cc;font-family:verdana;font-weight:bold;font-style:italic;">Bookmark Us</a>

this will make a text link called Bookmark Us the text color is currently blue you can change it by editing the color code and the font size.

jim

Windameer Farm
02-06-2007, 03:13 PM
navaldesign,

I attempted to use this on my home page (index). I worked but I wanted to us a picture for the button and that didn't work it came out a sliver white insted may i ask what i did wrong?
(sorry for my spelling here I have ispell but it desided not to work today just keeps asking me to redownload it.)

Jolen

navaldesign
02-06-2007, 06:26 PM
Redownload what ? To insert the image, just edit the button style, and use an image. The image has to have the same dimensions or it will be distorted or tilled.

Windameer Farm
02-06-2007, 07:19 PM
Ok thank you I think it's working now.

Thank you for taking the time to post back to me.

Jolen

coffeegourmet
03-22-2007, 05:22 AM
Naval,

Okay I put the script in one of my pages than went to insert, form, advanced button. the button comes up but when I double click it nothing happens. I tried it five times with the same result.

navaldesign
03-25-2007, 07:05 AM
Please provide a link to the problematic page. Did you link the button to the script ?

Dream Lady
03-25-2007, 08:30 AM
Once again, Naval....great tip. Thank you...works like a charm!
Cindy

coffeegourmet
03-25-2007, 08:42 AM
I don't know, I took the button off since it was not doing anything!

navaldesign
03-25-2007, 10:29 AM
I don't know, I took the button off since it was not doing anything!

You need to set the button properties to the javascript. to do so, please follow these instructions:

For the button properties, select the following:
Button Type: OnClick
OnClick Action : Execute Javascript function

In the OnClick value field type in javascript:bookmarksite('site_title', 'site_URL')

Replace "site_title" with the actual title of your site, f.e. 'Studio Navaldesign'.
Replace 'site_URL' with the actual URL of your site (or that of the specific page, f.e. 'http://www.navaldesign.info'

navaldesign
03-25-2007, 10:29 AM
Once again, Naval....great tip. Thank you...works like a charm!
Cindy

Thank you Lady!!

coffeegourmet
03-25-2007, 12:28 PM
Naval,

I found that I have to right click on the button and open the properties, if you do that it will work like a charm! :) Silly me! I will add it tomorrow to my php menu page, which is working like a charm too! Thanks for the great stuff! :)

acejase
12-14-2007, 06:51 PM
thank you so much, i did forget the last bracket, but the error on page message told me it was expecting it, so i repaired and works perfect.

i am relatively new to this and appreciate so much your easy to understand instructions