I was thinking about different ways to apply the owrap theme that's
typical for most applications.

I like the way that z3c.pagelet does it:

To summarize, views are registered through a different directive, and
then a layout is applied with a special directive. The advantage here is
that the views no longer specify their master template. It's configured
externally through zcml. This, theoretically anyway, allows more view
reuse since they can be registered with a separate owrap in a different
application without modification to the view code.

Anyway, I have a simple poc implementation for repoze.bfg.
$ svn co http://svn.repoze.org/playground/rmarianski/rm.owrap/trunk/ rm.owrap
$ cd rm.owrap
$ python bootstrap.py
$ bin/buildout
$ bin/test
$ bin/paster serve src/dummyapp/dummyapp.ini

Like z3c.pagelet, it adds a new directive for view registration. But
instead of a new directive for the layout, it just uses a plain adapter
to get the owrap. A new directive might be better because it would stand
out more in the zcml, but it was easier to do this way for a poc.

Repoze-dev mailing list

Reply via email to