Username: Save?
Password:
Home Forum Links Search Login Register*
    News: Welcome to the TechnoWorldInc! Community!
Recent Updates
[April 24, 2024, 11:48:22 AM]

[April 24, 2024, 11:48:22 AM]

[April 24, 2024, 11:48:22 AM]

[April 24, 2024, 11:48:22 AM]

[April 03, 2024, 06:11:00 PM]

[April 03, 2024, 06:11:00 PM]

[April 03, 2024, 06:11:00 PM]

[April 03, 2024, 06:11:00 PM]

[March 06, 2024, 02:45:27 PM]

[March 06, 2024, 02:45:27 PM]

[March 06, 2024, 02:45:27 PM]

[March 06, 2024, 02:45:27 PM]

[February 14, 2024, 02:00:39 PM]
Subscriptions
Get Latest Tech Updates For Free!
Resources
   Travelikers
   Funistan
   PrettyGalz
   Techlap
   FreeThemes
   Videsta
   Glamistan
   BachatMela
   GlamGalz
   Techzug
   Vidsage
   Funzug
   WorldHostInc
   Funfani
   FilmyMama
   Uploaded.Tech
   MegaPixelShop
   Netens
   Funotic
   FreeJobsInc
   FilesPark
Participate in the fastest growing Technical Encyclopedia! This website is 100% Free. Please register or login using the login box above if you have already registered. You will need to be logged in to reply, make new topics and to access all the areas. Registration is free! Click Here To Register.
+ Techno World Inc - The Best Technical Encyclopedia Online! » Forum » THE TECHNO CLUB [ TECHNOWORLDINC.COM ] » Techno Articles » Webmaster » Web Development
 Creating A Custom Button
Pages: [1]   Go Down
  Print  
Author Topic: Creating A Custom Button  (Read 1761 times)
Stephen Taylor
TWI Hero
**********



Karma: 3
Offline Offline

Posts: 15522

unrealworld007
View Profile
Creating A Custom Button
« Posted: July 28, 2007, 12:10:04 PM »


This article is a simple step-by-step guide for webmasters who want to create a Google toolbar "push button" with an icon that navigates to a site, displays an RSS feeds of that site in a drop down menu; host the button and make it available on their website. This type of button is a great way to gather all the sites of interest to you in one place in an attractive way.

A custom button is an .XML file (like feeds) and its properties and behavior are defined with a <*custombuttons> element.

The XML file elements we are going to use are following:
title- is the name of the button;
description- acts as a tooltip;
site- defines a link to a website;
icon- 16x16 .ico file which many sites use as their favicon.ico file and it has to be base64 encoded;
feed- adds the ability to open a dropdown menu with RSS feed titles and links.

As an illustrative example, we are going to use www.mygiftgadgets.com website, because this site has feeds and an icon.

The following basic XML produces a button that, when clicked, opens www.mygiftgadgets.com in the current browser window, has a title and displays a tooltip:

<*?xml version="1.0" encoding="utf-8"?>
<*custombuttons xmlns="http://toolbar.google.com/custombuttons/*">
<*button>
<*site>http://www.mygiftgadgets.com<*/site>
<*title>MyGiftGadgets.com<*/title>
<*description>Shopping for Gifts and Gadgets<*/description>
<*/button>
<*/custombuttons>

Now that we have the main button elements in place we need an icon. You can draw a small picture using any picture editing program you may have and save the picture file to your desktop, so that you would find it easily. As mentioned before the size of the icon needs to be 16x16 pixels. The easiest way to accomplish this would be by first, generating a favicon.ico from the picture (which you can do here: www.chami.com/html-kit/services/favicon) and saving the file to your desktop. Second, encode the favicon.ico file into ASCII text using base64 encoding (www.motobit.com/util/base64-decoder-encoder.asp), which in the end produces a base64 string - a long line of letters and numbers. As you can see creating an icon doesn't require any program installations to your computer!

The base64 string (your icon) has to be placed between the <*icon> and <*/icon> elements as shown in the final XML file example.

MyGiftGadgets.com site also has feeds that can be shown in the dropdown menu of the custom button. In the XML file the feeds URL will be displayed between the <*feed> and <*/feed> elements like this:

<*feed refresh-interval="3600" refresh-menuitem="false">

http://www.mygiftgadgets.com/wordpress/wp-rss.php<*/feed>

where the feed elements are:

refresh-interval - number of seconds to wait before reloading the feed, the default is 3600 (1 hour);
refresh-menuitem="false" - hides the refresh menu item any time a successful connection is made to the server.

Adding the icon and feed elements to our basic XML structure will complete the button file and the final XML file of MyGiftGadgets.com custom can be seen here: www.mygiftgadgets.com/mggbutton.xml

Now we are going to save the text file as mggbutton.txt and upload it to our website hosting root directory, then change the file name into mggbutton.XML and we’re done with the file!

The next step is to link to the button from our site. To do that we have to create an installation link by using the following URL syntax for our mggbutton.XML file:

http://toolbar.google.com/buttons/add?url=http://www.mygiftgadgets.com/mggbutton.xml

When a user clicks on this link, the MyGiftGadgets.com button is installed in their Google toolbar. If the user doesn't have a compatible version of the toolbar, they'll be prompted to install it and the custom button will automatically be added.

After we’ve made sure that the custom button that we've created works (to make sure try adding it to your toolbar!) it is time to add the button to the Button Gallery by filling out the button gallery submission form (www.google.com/support/toolbar/bin/request.py?contact_type=button).

Note: "*" element is not part of the encoding and needs to be removed when using in a .xml file. It's here so that the article can be displayed properly.

MyGiftGadgets.com online shopping site for gifts, gift ideas and gift gadgets. URL: http://www.mygiftgadgets.com

Logged

Pages: [1]   Go Up
  Print  
 
Jump to:  

Copyright © 2006-2023 TechnoWorldInc.com. All Rights Reserved. Privacy Policy | Disclaimer
Page created in 0.1 seconds with 25 queries.