Here is a quick tutorial on how to add your own custom button to Google Toolbar. I decided to pick something extremely simple for my first article. There's not really even any coding involved, just a simple XML file and a link!
You will need to compose an XML document. Google will use this to create the button. It's nothing fancy - really! If you don't know what XML is - don't worry about! To start, take a look at the contents of the Green Marines XML file:
- <custombuttons xmlns="http://toolbar.google.com/custombuttons/">
<description>A free community for US Marines.</description>
<icon mode="base64" type="image/x-icon">
Most of this is the Base64 encoded icon - we'll get to that in a minute. What you need to do is copy the above XML, then begin replacing the values inside the elements. The elements are:
site - The location the browser will be directed to if someone clicks your button.
title - The name of your button.
description - Keep it short, this will appear when your mouse hovers over the button on the toolbar.
update - the location of the XML file.
icon - Base64 encoded representation of your button's icon.
feed - an RSS or ATOM feed added to your button (required if you want to submit your button to the Google Button Gallery). You can add more than one too!
You don't need all of them. The main ones are in bold above. Just replace the values between these tags in the XML with your own. To Base64 encode an image for your button, determine or create your image. (I used Green Marines favicon.ico since it will be made of 16 x 16 pixels anyway). Then use this page to encode your image. Copy the result into the image element of your XML document.
If you have an RSS or ATOM feed, insert the URL of your feed into the
feed element. Save your document with a .xml extension (we used updated_button.xml). Copy the XML file to the root of your website directory. It's ready to go!
Now, just add the below link to your site, wherever you choose, and when people click it, they will get your button added onto their Google Toolbar:
url= with the fully qualified public URL to your XML file. If someone clicks the link and doesn't already have the correct version of Google Toolbar installed, they will be prompted to install the correct toolbar.
That's it! For more detailed instructions, go here: http://www.google.com/tools/toolbar/buttons/apis/howto_guide.html.