How to install a widget via a plugin

Sidebar Manager is not just a plugin, it is a platform. One of the core principals of Sidebar Manager is to provide other plugin developers with a tool they can leverage in delivering cool functionality to their users. For example, suppose you are Tim Appnel. You could have your Feeds.App plugin install an RSS feed widget into Movable Type. Users could then add that widget to their sidebar in a click of a button, using the Sidebar Manager plugin and platform.

The following is a snippet of Perl code that shows how to create a sidebar widget that can be integrated with Sidebar Manager. As you can see, all you need to do is create a template module with a name prefixed by “Sidebar: ” and Sidebar Manager will assume it is a side widget to be manipulated.

require MT::Template;
my $tmpl = MT::Template->new;
$tmpl->blog_id($blog_id);
$tmpl->type('custom');
<b>$tmpl->name('Sidebar: Example Widget');</b>
$tmpl->text(<<END_TMPL);
Your template code goes here.
END_TMPL
$tmpl->save;

2 TrackBacks

Let me say Happy Holidays to the Movable Type user community. Thank you for helping to create one of the best and more extensible blogging platforms today. As a special holiday gift to the Movable Type users, I have just... Read More

It has been less than twelve hours since the release of Sidebar Manager, and I already have got some wonderful feedback and questions. One in particular I would like to highlight: I am, however, a little confused on how the... Read More

No Comments

Leave a comment

what will you say?


Close