Okay, lots of stuff going on in here.

I've been talking with developers on the iGoogle team about the best way to
go forward here and it looks like keeping UserPrefs in the query string for
type url gadgets is the thing to do. The fact that we have documented the
urlparam attribute at
http://code.google.com/apis/gadgets/docs/reference.html#Userprefs_Ref is
relevant but I also see there's something wrong in the code snippet there
since it uses _IG_Prefs instead of gadgets.Prefs. It looks like that was
copied straight from the legacy docs at
http://code.google.com/apis/gadgets/docs/legacy/reference.html#Userprefs_Ref.
We try not to break gadgets in any event but in this case it looks
like
we've stated in the docs that this is the intended behavior (that UserPrefs
end up in the query string). That said, I haven't heard any problems with
changing the location to the fragment for type="html" gadgets so either they
all use the Javscript API to get the parameters or the code to pull out the
parameters wasn't badly affected.

iGoogle does still support the legacy API until September (as previously
announced), so in the short term it doesn't matter which part of the API
this is documented in. I'm going to have to correct the documentation, at
least the example code, for the docs on UserPrefs on the gadgets.* API (time
to toss that example down the memory hole).

Longer-term, it's possible that the UserPrefs will be serialized (i.e.
stored, saved, passed, etc) in a different way. The documentation should be
updated and the change communicated significantly before that happens. If
you can avoid relying on the structure of the url then this can reduce the
impact of any such change on your gadget.

I do still believe that for many cases the user experience is better using
the structure I showed earlier. Of course that's up for debate and I'm
interested in seeing performance comparisons.

Roy, I expect there's some different processing that happens for your
gadgets that use the library injection than what happens for gadgets that
don't. In the syndication set up page, I see the white box but I don't see
the reason for it yet. I'll have a look in to it and see what I can come up
with.

Thanks again for your patience,
Rob Russell
Google Developer Relations


On Sun, Apr 25, 2010 at 6:29 AM, Roy <[email protected]> wrote:

> I find that I have to agree with Gavin and Jeremy.  I certainly
> always thought that the "urlparam" described in the gadgets reference
>
>    http://code.google.com/apis/gadgets/docs/reference.html#Userprefs_Ref
>
> implied that the passing of preferences to url-type gadgets in the URL
> was, in some sense, a documented and approved way of doing this stuff.
>
> I appreciate that, as a gadget hacker, I'm basically playing in
> Google's
> sandpit and it's entirely up to Google what toys are provided.
> I also appreciate the point that using the API is, by many measures,
> "the right way to do it".  However, the fact is that user preferences
> have been available in the query string for a long time - perhaps
> since
> the inception of gadgets.  This of course made it trivial for whatever
> was at the end of the URL to grab and use these parameters as
> required.
> It's natural enough that people might use this to feed their gadgets.
> I'm not saying that makes it the correct thing to do, just that it's
> understandable that this has come to pass.  That said, I think there'd
> be a lot of happy URL-type gadget developers out there if it were to
> be
> resolved to keep user preferences in the query string for the longer
> term.
>
> One aspect of this recent change I have some trouble reconciling is
> that
> the parameters passed to a gadget appeared to differ, depending upon
> whether the gadget was sitting on an iGoogle page or on an external
> webpage.
> During the whole affair I found my gadgets that had ended up on
> webpages
> to be unaffected, happily receiving userpref values in the query
> string,
> as always.  Perhaps this is one of the joys of using what turns out to
> be an undocumented feature, but it will be interesting to see how this
> may change in the future.
>
> Rob, thank you for the example code you posted in the other thread...
> my knowledge of javascript is certainly rising towards zero.
> I've had a crack at incorporating this in to a gadget I'm working on
> at the moment (switching it from type "url" to "html"), and I do have
> a question, please.  The gadget seems to work well when added to an
> iGoogle page, e.g.
>
>
> http://fusion.google.com/add?source=atgs&moduleurl=http%3A%2F%2Fwww.telescope-net.com%2Fgmodules%2Fyour-moon.xml
>
>
> However, if I try to use the "Add this gadget to your webpage"
> previewer, e.g.
>
>
> http://gmodules.com/ig/creator?synd=open&url=http%3A%2F%2Fwww.telescope-net.com%2Fgmodules%2Fyour-moon.xml
>
>
> I just get a white box.  Clicking "Get the Code" gives exactly the
> right
> code to make the gadget work on a webpage, it's just that the gadget
> doesn't
> appear in the previewer box.  I have only managed to get it to appear
> if
> I omit all of the "gadgets.*" calls.  Is there something else needed
> in the
> XML file to make the gadget appear correctly on that /ig/creator page?
> Is there something that I'm doing wrong in my boneheaded ignorance?
>
> Thanks!!
>
>
> Regards,
>        Roy
>
> --
> You received this message because you are subscribed to the Google Groups
> "iGoogle Developer Forum" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<google-gadgets-api%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/Google-Gadgets-API?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"iGoogle Developer Forum" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/Google-Gadgets-API?hl=en.

Reply via email to