I'm attempting to port a Wordpress widget plugin to a Blogger gadget, and finding them extremely different worlds. What the WP widget does is:

  1. In the admin interface (provided by the widget object's form() method), it displays a list of the posts in the blog for the blog owner to select from, saving this as a widget setting.
  2. In the widget display (provided by the widget object's widget() method), it displays some content linked to the post that was selected.

This seems to be bizarrely difficult behavior to replicate in a Google Gadget. The questions I wind up having are:

  1. As far as I can tell, Blogger barely has a concept of an admin interface, and certainly none that would manage widgets. It seems like I need to deploy admin and user functionality through the same gadget display; am I correct about this?
  2. I can get at a list of blog posts easily enough, but how in the world do I create a setting that's global to the widget instance instead of specific to the user viewing it? I get the vague impression that that may be possible through OpenSocial in some way, but damned if I can figure out how.
有帮助吗?

解决方案

Have you already checked the links: https://developers.google.com/blogger/docs/gadgets/gadgets_for_blogger and https://developers.google.com/gadgets/docs/basic ? They should have enough info for the item no 1.

Please note: With recent addition of dynamic views it seems like you need to hack stuff in order to make your gadget work when dynamic views are enabled (see this article). Perhaps they'll improve that in the future but the last blogger gadget announcement related to dynamic views was in feb 2012 dynamic-views-update-3-gadgets.

For the item no 2, I am not sure either. Maybe they'll add that in the future.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top