Six Apart Developer Center

Developer Center Home » Product Documentation » TypePad »

How to insert a header for your widgets

Posted by Byrne Reese on December 5, 2006

When a widget is added to your TypePad weblog, TypePad automatically wraps the widget in a little HTML to assist in styling and your widget's layout. However, a widget developer recently pointed out that by wrapping the widget in this way, they were unable to insert an HTML H2 header in the proper location so as to make the widget's header appear identical to the other headers in the user's sidebar.

To circumvent this little nuance, Walt wrote a little Javascript that can be included in your widget code that inserts a module header in the proper location within the page:

This script above builds a `module-header` H2 and inserts it before anything else in the `widget-iWalt_com_netflix` DIV.

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

Related Categories

Six Apart
Makers of weblog software and services for individuals, organizations and businesses.
This website is powered by Movable Type.