Skip navigation.

Widgetize! blog

not made with actual magic

The making of the widget

Here's how we make the widgets at widgetize.

1. Make a widget

This step may seem obvious, but the first and most important step is actually creating a working widget. As a matter of fact, it's even more work than creating a regular widget, since you need to make sure it works on any site, any feed, any crazy username, etc etc.

2. Make several independent skins

This usually means making an easily skinned widget. A popular approach is to make a 'base' CSS file with all the positioning and layout, and a second 'skin' CSS file with colors and other skin-specific styling. You're doing it right if you can just delete the old skin folder and copy in a new one, and the widget still works. Of course, the real work is creating the images to be used. Unless you have a pet designer reliable designer comrade, that is. But few people have that luxury.

3. Create a config.js

Now that we have a working widget, we need to make it flexible. A feed reader needs to be able to take any feed URL as input, and we don't want to go messing around in the JS files for every instance of something that should be changed. Instead, we have a file called config.js. This contains a single JS object, called SkeletonConfig. The object has properties for all the variable variables, so to say. Below is a copy of the config.js from this blog's feed reader widget.
var skeletonConfig = {
feedURL : "http://my.opera.com/widgetize/xml/atom/blog/",
feedTitle : "Widgetize! blog",
feedVersion : "generic",
maxItems : 9
};
We have the feed URL, the widget title, the feed type and the maximum number of feed entries to present. 'generic' in this case means the feed parser should detect whether it's getting Atom or RSS.

4. Use the config.js

This means finding all the places you used that feed URL and replacing them with skeletonConfig['feedURL'] -- or you can just set the variable you were using equal to skeletonConfig['feedURL'] during the widget initiation. Do the same for other input from config.js. Another important point here is that we set document.title = skeletonConfig['feedTitle']. This may seem odd at first, since widgets don't have any chrome to show the title in. However, this is also the name used for the widget's taskbar text. And what about the widgetname in the widget list (config.xml entry)? Well, we actually change that on the fly while creating the widget zip since it's not possible to modify after the widget is installed. If you're saving data between uses, you also have to make sure you don't accidentally override your stored preferences with the defaults, or override the defaults with the initially undefined preferences. Lots of fun to be had for all.

... and then the magic

A final touch is needed to make it all come together. But that's another story.

There'll be some changes done

Comments

peteremcc 2. August 2006, 22:25

i think the feed widgets would be more useful if you could add multiple feeds to each one.

then you could group all your feeds by topic into a few widgets, or even have all of them on the sae one.

peter

chesss 4. August 2006, 04:30

I second peter's idea there.
Then the widget would become more like a desktop rss reader.

kdd 8. August 2006, 02:28

what happened to the developer tool bar. i up graded and now it's gone and i can't find it to reinstall. this is the only forum i have found all day to address this issue. sorry for the ot post if it is.

kdd

hzr 8. August 2006, 08:51

Hi.

Multiple feeds are currently not planned. However, take a look at http://www.planetplanet.org/ which is a software that combines several feeds into one. Hope that helps.

seifip 8. August 2006, 15:25

I`m citing from "Apple OS X 10.5 "Leopard" officially debuts" at www.engadget.com:

Dashboard - New Dashcode tool allows visual template-based Widget development. There's also a new Web Clip app that takes any part of a web page and turns it into a Widget.



Is it possible to make some analog of Web Clip in Opera so that i could click for example an rss reader, flash movie, or anything else on any website and use it as a widget?? It would be definitely cool...

dalibor42 20. July 2007, 13:50

When you put an apostophe (') in title Widgetize adds '\' in final widget.

laurentr 18. August 2009, 14:23

Feed reader widgets seems to be unable to fetch a feed using a secure connection. Is it possible to do it?

Write a comment

You must be logged in to write a comment. If you're not a registered member, please sign up.

December 2009
S M T W T F S
November 2009January 2010
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31