List Info

Thread: Re: Layouts in pylons




Re: Layouts in pylons
user name
2008-02-24 03:04:04
Thanks for the replies guys..

I'm not a great at making convincing arguments.. Hopefully
I'm making
some sense.

I built an application framework with a friend based off
cherrypy.
It's basically turbogears but coded from scratch. We
basically built a
filter (or middleware) that can map request paths to a
layout
controller. For instance, you could write..

/secure/.* = controllers.secure.SecureLayout

This maps any request with the path /secure to a controller.
This
controller has a html layout associated with it. We then
take the html
from the response and insert it into the layout. This
functionality
allows us to add layouts to paths in a flexible manor. Since
the
layout is associated with a controller you can have that
controller
execute some code before rendering.

I asked about what other people are doing first because I'm
curious.
If you think this code could be useful maybe I can abstract
it out for
pylons.

Chad


On Feb 22, 10:51 am, Ben Bangert <b...groovie.org> wrote:
> On Feb 22, 2008, at 8:23 AM, Chad wrote:
>
> > Unfortunately, my company uses Genshi so I'm out
of luck :( Maybe I'll
> > build a sitemesh into pylons so that it works with
all templates...
>
> I'm not sure why that's a problem. Genshi processes
variables for
> substitution before most anything else I believe.
>
> For example:
>
> <xi:include
href="../layout${c.theme}.html" />
>
> Where c.theme references some theme that was setup. You
can xinclude
> using variables. Was that the problem?
>
> Cheers,
> Ben
>
>  smime.p7s
> 3KDownload
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "pylons-discuss" group.
To post to this group, send email to pylons-discussgooglegroups.com
To unsubscribe from this group, send email to
pylons-discuss-unsubscribegooglegroups.com
For more options, visit this group at h
ttp://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---


[1]

about | contact  Other archives ( Real Estate discussion Medical topics )