[Zope3-Users] Re: AW: Re: AW: View or content provider
daniel.nouri at gmail.com
Tue Jul 17 09:41:07 EDT 2007
Roger Ineichen wrote:
>>> I do not recommend using views for content that is only
>> used inside a
>>> template. Because "context/@@viewname"
>>> is also traversable as a real view and will probably show up in
>> How would it show up in Google? Google bots don't try
>> arbitrary URLs, they follow links.
> This could happen if you update a project and remove a public view
> called detail.html and register a "inline" view with the same
> name whihc you liek to use for calling in ZPT. Just kidding.
> I know this doesn't happen in a project, but are you realy sure.
> What's the benefit to register views and call them in ZPT
> like tal:content="structure context/@@foo_bar" ?
> For beeing fair,
> one benfit is probably the usage of memcached. Such views allows
> you to easy cache them self, because they are traversable by it's
> own url. But be carfully, probably they should get cached just
> once from a unique url and not on different urls used in each view.
Yes, caching is one of my main motivations here. The unique URL / different
URL caching problem is one that viewlets have as well, AFAICT.
One big plus that you're leaving out is the reusability, just like with
viewlets. In fact, I believe that with my approach, I have most of the
benefits that zope.viewlets have. And I in many cases I can get away with
registrations that are more intuitive to work with than the quadruple
adapters + managers that viewlets use.
>> Using ordinary views for parts of a HTML page works perfectly for me.
> Of corse it's possible to do that, but this doesn't mean it's a good
> concept in every usecase.
> My note on that topic should not say "don't use it", it should only make
> people think about the options we have in z3 and point on some side effects?
Sure, I agree that this a good thing. However, I thought that there must be
better arguments for using viewlets than the traversable / not traversable one.
More information about the Zope3-users