|
|
Configuration In-DepthThis guide covers the Clearspring configuration mechanism, and its advantages in greater detail. If you're looking for an in-depth understanding of the mechanism, and it's advantages, it's worth a read.
The Basics of Widget Configuration
All but the most basic widgets leverage some kind of configuration. That is, they need some kind of parameters to control their behavior. This could be anything -- something simple like a color to use to display a UI component, or an RSS feed to gather information from a server, or even preferences specific to an individual viewer of the widget. Usually, these parameters are a combination of things you as the widget developer care about and don't really want users to know about, and some things the user needs to deal with, either explicitly or with your help. This is widget configuration at its simplest -- somehow you've got to get parameters into the widget, and then offer a way for end users to change the ones that you want them to be able to. Some Common Techniques, and their ProblemsWith most widgets, and even some widget platforms, the parameters are written into the code that a user includes in their site or page. In other words, if you have a widget that shows a particular user's music listening history, you might have the username for the music tracking service in the code that you embed. For javascript, it might be written into the javascript or passed as a URL argument, and for Flash these are often passed as FlashVars. So you might have a Flash widget that has its parameters set in an embed tag, for use in Myspace. With these techniques, the code you generate to include a widget somewhere is basically hard-coded to a certain set of parameters -- parameters which can't change without actually changing the embedded code. If you are a widget publisher, this means you can't modify the appearance or other behavior of the widget once it's put somewhere without building in a complex back-end infrastructure and maintaining it yourself. It also limits the ability for users to share widgets between each other, as the new copies will not be configurable for the new user.Other common techniques include using cookies to store a user's preferences, but those are of course only available after the widget is initially displayed (and it sets its cookies), and are only available to that one individual viewer of the widget. The Clearspring SolutionWhen you distribute your widgets through the Clearspring platform, two things help you eliminate all of these problems. First, our Widget ID/Placement ID (WID/PID) scheme, which identifies not only each widget, but also each instance of each widget. When you upload your widget on our platform, it gets a unique Widget ID. There's also, however, a unique Placement ID every time your widget is placed somewhere (like on a user's social network page). This means Clearspring knows about the difference between different instances of your widget on the Interwebs. Building on this, the second thing that really brings this together is that your configuration parameters are hierarchically assigned to the Placement ID, and managed completely dynamically by our servers. So, if you have a widget that accepts some parameters, here's how it goes:
Why does this matter? Well, it gives you as a widget publisher a number of significant advantages:
There are some other advantages, like the fact that you can override parameters by specifying URL arguments to our widget server, and getting a small amount of parameter security by not exposing them at all. There's also a lot of fancy stuff you can do with this whole system that we'll get to over time, especially once we start talking about analytics, but this is the basic idea. Note: One very important thing to keep in mind is that parameters that are set at the placement level per user -- parameters that are set by a user from within the get and share menu -- are now locked down for that placement. The user can change these values again, the server is no longer using global values for them, so changes you make in the widget console to those default values will not be used. |