Gone crazy with functionality.

2 views
Skip to first unread message

Owen Winkler

unread,
Feb 4, 2008, 8:26:15 AM2/4/08
to habar...@googlegroups.com
r1336 allows for some interesting functionality.

Please have a look at my embryonic plugin, customctypes:
https://svn.habariproject.com/habari-extras/plugins/customctypes

The purpose of this plugin will be to allow you to create custom contect
types on the fly from within the admin. The plugin does a few things
that you couldn't really do as easily before.

First, it adds a new item to the menu, which I know we've discouraged
(and will continue to do), but the interface for this plugin will need
and make good use of the extra room.

Second, it implements a new admin page to accompany the new menu item.

Third, it overrides the publish page for content types that you create
with it. So if you create a new content type "aside", then instead of
displaying the standard post interface, it will display an interface of
its own. It will also let you build your own entirely custom interface.

With those things implemented, the plugin allows you to add arbitrary
new content types. You can't yet delete content types -- I'm still
thinking about how to safely delete content types if there are posts
that are of that type. Likewise, if such a plugin provides a way to
manipulate and output these new content types, then what happens if you
deactivate the plugin? These are interesting puzzles yet to be worked out.

Preliminary testing shows that Habari is built well enough to handle new
content types with hardly any work. Actually, I didn't need to do
anything to make that happen, which made me happy.

This is good news since we know that fancier features we've been
planning all along are not far off. I expect this plugin can be
finished to allow amazing customization to the publish page for each new
content type that is invented.

From the new plugin page, you could specify the order and container
(whether in the main publish page area or in a "tab") of controls, and
then also specify if the control values should be stored in the postinfo
table or in a new table that is joined to the post table when the posts
are gotten.

Another potential use of this plugin could be to create a data structure
in which plugin or theme directory information could be stored. This
would allow us to create a plugin and theme directory using Habari
without actually having to write much internal code to do it.

I don't really expect this to be a 0.4 feature, but I think that a
plugin such as this might be an excellent core addition, and the hooks
that allow it to happen were plainly useful and easily implemented, so I
did.

Anyway, a little code review for sanity's sake would be appreciated.

Owen


Michael Bishop

unread,
Feb 6, 2008, 12:03:16 PM2/6/08
to habari-dev
I tried the plugin, but after adding a content type, then clicking on
the new type to edit it, nothing happens. It shows under create, but
it's the same fields. Obviously I'm missing something. My goal would
is to create a links content type, to see if it could be used to
manage a blogroll, but maybe I'm on the wrong path.

~miklb

Owen Winkler

unread,
Feb 7, 2008, 9:22:00 AM2/7/08
to habar...@googlegroups.com
Michael Bishop wrote:
> I tried the plugin, but after adding a content type, then clicking on
> the new type to edit it, nothing happens. It shows under create, but
> it's the same fields. Obviously I'm missing something. My goal would
> is to create a links content type, to see if it could be used to
> manage a blogroll, but maybe I'm on the wrong path.

The plugin is as-yet incomplete. It will eventually let you modify the
fields that are available to publish the content type you create.

Owen

Reply all
Reply to author
Forward
0 new messages