Re: Conditionally render viewlet

Sylvain Viollon <[email protected]> Thu, 9 Jun 2011 13:28:06 +0200
Newsgroups gmane.comp.web.zope.silva.devel
Organization Infrae
Message-ID <[email protected]>
On Wed, 8 Jun 2011 15:54:05 +0200
Antonin AMAND <[email protected]> wrote:

 Hello,

> On Wed, Jun 8, 2011 at 1:37 PM, Jonathan Bowlas <j.bowlas-hclig2XLE9Zaa/[email protected]>
> wrote:
> > Is there an example infrae extension or theme where the filter
> > method is overridden?
> >
> > J
> 
> Sorry. filter method takes the viewlets as parameter.
> 
> def filter(self, viewlets):
>    viewlets = super(LeftColumn, self).filter(viewlets)
>    return [(name, viewlet) for name, viewlet in viewlets if
> viewlet.available()]
> 
> 

  If this is often used, we could add a base class into
  silva.core.views that contains it by default.

  Regards,

  Sylvain,


-- 
Sylvain Viollon -- Infrae
t +31 10 243 7051 -- http://infrae.com
Hoevestraat 10 3033GC Rotterdam -- The Netherlands