Google Gadgets (Views)

I’ve been looking into making my puzzles available as a Google Gadget. The process doesn’t seem too difficult – just a little unwieldy. Today, I want to talk about one small (but important) aspect of Google Gadgets: Views.

Views

Views are the “frames” (warning: implementation-dependent pun) that surround the rendered images of gadgets. There are several different types of views (e.g. “default”, “home”, “profile”, “canvas”) with different properties – primarily size. Different views are available in different “containers” (e.g. iGoogle, orkut).

The significance of this is that a gadget’s presentation must be tailored for the views in which it will appear; in particular, gadgets must be written to use an appropriate amount of screen space. If a gadget requires a large display, that display should be assigned to the gadget’s “canvas” view, with a special teaser view assigned to its “default” view.

Example

Here is an example of a (very) simple “Hello, World” app with a teaser view:

<?xml version="1.0" encoding="UTF-8" ?>
<Module>
  <ModulePrefs title="Hello World!" height="100">
    <Require feature="views"/>
  </ModulePrefs>
  <Content type="html" view="home">
    <![CDATA[
        <script type="text/javascript">
          function GoToCanvas()
          {
                gadgets.views.requestNavigateTo(new gadgets.views.View("canvas"));
          }
        </script>
        <p>Hello, world!</p>
        <p><a href="javascript:GoToCanvas()">Canvas View...</a></p>
    ]]>
  </Content>
  <Content type="html" view="canvas">
    <![CDATA[
        <p style="font-size: 8em;">Hello, world!</p>
    ]]>
  </Content>
</Module>

Future Work

I’m going to continue to experiment with widgets. I’m also experimenting with an increased ad budget. Here’s what’s coming up:

  • More widget work
  • Try to better position the aStore on the puzzle page
  • Post some messages on puzzle forums

Weekend Stats

Stat 17th 18th 19th
Visitors 17 10 23
Visits 26 11 24
Pageviews 123 32 73
Pages/Visit 4.73 2.91 3.04
Avg. Time on Site 4:31 4:23 1:31

Okay – bloody awful. I’m trebling my daily ad budget; let’s see if the numbers move at all.

Follow Along

You can subscribe to my RSS feed, if you’d like to follow along with this month’s project, in which I attempt to create and popularize a puzzle site.

Share and Enjoy:
  • Twitter
  • Facebook
  • Digg
  • Reddit
  • HackerNews
  • del.icio.us
  • Google Bookmarks
  • Slashdot
This entry was posted in Projects, Web stuff. Bookmark the permalink.

Comments are closed.