Embed Widgets Roadmap

The Embed Widgets module is undergoing several changes. As a Google Summer of
Code project and my first attempt at programming in Drupal, the module became
rather bloated. Too many use cases were covered and the result was that the
module was not easily extendable. In recent months, Embed Widgets has been
refactored with the goal of simplification and extensibility. This roadmap will
outline what is done, what needs to be done, and where the module is going in
the future.

What's Done

  1. A New Approach
    • In the old module, there were different 'types' of widgets: IFrame,
      Google Gadget, etc. However, many widget platforms actually support
      multiple formats (IFrame, Flash).
    • The new module separates the idea of a widget format from a widget
      platform. A platform, such as Google Gadgets is compatible with Flash
      and IFrame formats. Facebook profiles, however, are only compatible with
      Flash widgets. (See

      http://www.clearspring.com/docs/tech/distribution/destinations
      for
      more examples.)
    • Drawing further inspiration from the ClearSpring platform, a
      distinction was made between a 'widget' and a 'widget placement'. "To
      borrow an analogy from object-oriented programming, a widget is a class.
      It only really exists for the end user once it is instantiated--i.e.,
      once it's added to a web page as an <object>, <embed> or <script> tag.
      Once the first instance of a widget is created (a so-called "seed"),
      users can get their own versions and spread them throughout the web. To
      continue this analogy, we call each concrete instance of a widget a
      placement". (http://www.clearspring.com/docs/tech/core/wid-pid)
    • Essentially, a widget contains information about what content is to
      be displayed in the widget. A placement of that widget contains
      information about what platform it is being embedded and in what format.
    • The old module consisted of several module. Each type of widget had
      its own module. Also, Embed Widgets depended on several other modules
      (Tabs, Color Scheme). These dependencies will be gone and the final
      package will consist of an API module and a UI module.
  2. Embed Widgets API
    • Simple, but powerful API to create widgets programmatically.
    • Sample Code:
      $my_widget = embed_widgets_new();
      $my_widget-&gt;source = embed_widgets_new_source(&#39;page&#39;, &#39;node/27&#39;);
      $my_widget-&gt;platform = &#39;googlegadgets&#39;;
      $my_widget-&gt;set_variable(&#39;width&#39;, 300);
      $my_widget-&gt;set_variable(&#39;height&#39;, 350);
      $my_widget-&gt;get_code(); // returns embed code
       
    • Currently, blocks, pages, and views can be used for widget content.
      Developers can also specify a callback to supply content:
      $my_widget-&gt;source = embed_widgets_new_source(&#39;callback&#39;, &#39;mymodule_widget_content&#39;);
  3. Widget Templates
    • In the old module, the templates used to render the widget were
      complicated and the implementation was hack-ish.
    • In the new module, template suggestions are made to the theme. By
      default, 'widget.tpl.php' is suggested. If the path 'node/27' is being
      viewed as a widget, 'widget-node-27.tpl.php' is suggested. This mimics
      the template suggestion scheme already used by Drupal, so themers should
      already be familiar with it.
  4. Additional Features
    • Forms are now working within widgets. (Was previously the most requested feature.)

What Needs To Be Done

  1. Embed Widgets API
    • Finish API to allow new formats and platforms to be added easily.
  2. User Interface
    • User interface for creating and managing widgets. Much of old UI can
      probably be used.
    • User interface for getting embed code within widget.
    • Create default theme for widgets.
  3. Other Tasks
    • Improve method for arguments to be passed to widgets. This is
      important for Views widgets and widgets that use callbacks to generate
      content.
    • Improve JavaScript container for HTML and JavasScript Widgets

The Future

  1. Additional Features
    • Flash widgets! Will need to create a flash container. Parameters
      will also need to be passed to the flash movie. (See

      http://www.clearspring.com/docs/tech/widget-config/configurable-flash
      )
    • Improve JavaScript container for HTML and JavasScript Widgets
    • Widget Tracking
      • Track 'pageviews' of widgets and widget placements.
      • Total number of child placements for widget
      • Number of children of this placement
      • Where was widget placed? Domain, URL
    • In-Widget Configuration
      • Allow parameters to be exposed to users.
      • Users can configure these parameters with widget. Those
        parameters are stored with that widget placement.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Nice work! "What's Done" improvements in 15Jan09 release?

Sounds like great work John. I'm looking to use this module and have the same question as above:

Are the "What's Done" improvements in the release from back in Jan 09? ... or is there an new release on the horizon?

This all sounds very cool - great job!

I'm curious, are any of your code improvements in drupal cvs or otherwise available?

Also, some inspiration might from from Sun's new http://zembly.com. It has a BYOAPI feature that might be worth looking at.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

More information about formatting options