coming from the world of plone...
All the example code uses a single controller per page, which is all
good and fine for crud operations on a database, but seems rather
limited for what we do.
I'd like to build a website (read a typical portal site) that brings
together several controllers/views into a single page (i.e.
/doc/view/123, /news/latest, /user/list, /user/view/myid)
How to do this in pylons? Is this a templating issue? Is it possible to
render a template fragment using a different controller?
thanks a lot for our insight.
--
________________________________________________________________
Paul Stevens paul at nfg.nl
NET FACILITIES GROUP GPG/PGP: 1024D/11F8CD31
The Netherlands________________________________http://www.nfg.nl
I'm developing a new templating system called art which handles this
particular case. Instead of using a controller to call a template and
display the result, the template effectively defines which content it
requires and calls the different controllers (called plugins in art)
automatically.
The individual plugins can run on multiple servers so that content can
be pulled in from remote locations and all the fetching is done in
parallel with threads so performance is pretty good.
There are some other features too such as the ability to define
templates from layout objects so that the people making the templates
don't necessarily need to know HTML, they just choose a header, footer
and two columns say.
If you are interested I'll try and put the latest code up in the next
few days.
Of course, in Pylons you can always have a single controller call
actions from other controllers (they are just WSGI applications) and
then assemble them yourself?
Cheers,
James
in template with page we call pool(id) in somewhere we want.
This is very flexible solution. We can decorate function with cache,
authorization, add some layout or timing. We can use components in
different projects, with different templating etc.
Climbus
I'd use subrequests, and then wrap that up in some object. I don't
believe Pylons exposes subrequests in a particularly friendly way, but
if you look at paste.recursive it will show you a not-as-friendly way to
do subrequests that you could pretty up on your own.
--
Ian Bicking | ia...@colorstudy.com | http://blog.ianbicking.org
All three approaches (special template engine, components, sub-requests)
look very usefull. I've got some studying and experimentation to do.
--
I was looking at the W3C docs on XInclude (which, like most W3C docs,
aren't terribly enlightening) and this sounds a bit like that (Genshi
supports that particular feature, BTW). Any particular differences with
XInclude? I've been planning on adding a similar feature to Breve, but
am interested in other people's ideas on particulars.
Also, since you can pull plugins from different servers, have you
considered the implications with regard to Javascript? It seems there
might be some security implications (or more likely, security
restrictions) that would affect Javascript that is pulled from different
servers (although I expect simply documenting such restrictions would be
adequate).
Regards,
Cliff