Here are some guidelines for writing, editing, testing and deploying Google Gadgets for Google Sites. Getting StartedHere we will cover the starting points for using gadgets on your site. The editing toolAlthough the code is pure HTML (with JavaScript, etc) embedded in XML, which can be edited by using any text editor available (from Notepad to Word), Google offers a tool for you to check your code. This is very useful because:
If you think this is not enough reason, think again. The first time you upload anything to be used as gadget (even if you leave the XML on your own web hosting), Google will cache your gadget for some time (around 2 hours, if I am not mistaken), so if you plan to test, and then upload the newer version again, note that it will take that long for the newer version to be replaced. So, the tool can save you this trouble. Some notes to consider though:
Writing the XMLEven if the Gadget will focus on the HTML rendering (read also the info below), writing the XML is as important as the code itself, since that is what defines all properties and information pertinent to your Gadget. With proper info, you help other people to use your gadget as well. Some of the attributes to consider: Module > ModulePrefs item
For a complete guide of the valid ModulePrefs attributes, see the Google reference:
http://code.google.com/apis/gadgets/docs/reference.html#Moduleprefs_Ref Writing the HTMLNo secrets here, actually. Just the HTML code (including iframes or javascript, for instance) that you can not directly input to your page, add it in the Content property: Of course, there are more complexity involved, in order to enable the customizable data, but the best for your to do here is to go directly to Google's documentation and read it carefully until you get what you want. You can also see some real examples and base on them to make your own (here are some I designed myself): Google's documentation: http://code.google.com/apis/gadgets/docs/legacy/gs.html Note: The version compatible with Google Sites is the Legacy version. Testing and DeployingYou may use the tool above for that, but for some strange reason, the embedded version of the Google Gadget Editor does not work in Google Sites, the following message is displayed: The workaround for this is to use your iGoogle page, and simply add this gadget there. It will work fine: Or, Google also offers a page where you can do that: http://code.google.com/apis/gadgets/docs/legacy/gs.html#GGE Adding the gadget to your pageFollow the steps so that you can apply them into your Google Sites pages, if applicable: Add new gadgetYou may find this option at: (Page in Edit mode) Insert > More...You will have to add it manually, clicking at "Add by URL", as shown below: Then place the URL of your gadget (it is the URL of the XML file uploaded in your iGoogle gadget). To get it, simply right-click the file title on the top right of the gadget panel, and copy the link URL.
Configure GadgetBased on the customizations you added to your gadget, they will be displayed here (Width and Height are default settings you can not disabled): Additional InfoFor general information on writing Google Gadgets, you may want to check this post as well: http://www.seoish.com/how-to-make-google-gadgets-intro/ |





