[typo] Engineering sidebars
pdcawley at bofh.org.uk
Fri Apr 7 13:09:01 EDT 2006
On IRC just now, someone was describing a navigational sidebar that
they were trying to write. The idea sounded really cool, but in order
to make it work well, he was going to have to write a 'first class'
controller to handle menu expansions in order to retain the menu's
state. Which meant he'd have to put something into typo's
app/controllers directory. Which is something we'd been trying to
avoid in the design of the sidebar system.
Meanwhile, in another project, I've been using a Rails Engine. The
rails_engines plugin is a cunning plugin which enables writing plugins
that, in essence shadow the main application's tree, complete with
their own controllers, models, lib, views, tests...
Which sounds like a perfect match for the kind of sidebar this person
was trying to write (and the techniques used to make engines go looked
like they might enable some seriously powerful themes, but that's
definitely in the blue sky category).
The catch is, having a full engine for each sidebar is definitely
overkill. So, I'm thinking of investigating pulling our current
sidebar system out into a 'typo_sidebars' engine, with the goal of
having a vendor/sidebars directory into which you would drop 'simple'
sidebars consisting of a SidebarPlugin based controller and
'configure' and 'content' views (Actually, I think it's not beyond
the bounds of possibility to have the configure view be entirely
autogenerated from metadata). More complex sidebars could then make
full use of engine capabilities by being distributed as engines in
their own right.
Has anyone had much experience working with rails engines? Thoughts?
Piers Cawley <pdcawley at bofh.org.uk>
More information about the Typo-list