<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman,new york,times,serif;font-size:12pt">Hi, guys.<br><br>I was wondering why viewlets in Grok, like viewlets in Plone, don't have a method to check their availability at the render time.<br>This would be as simple as changing the last line in the render method of the ViewletManager component (grokcore.viewlet:components.py):<br><br>class ViewletManager(ViewletManagerBase):<br>&nbsp;&nbsp;&nbsp; ...<br>&nbsp;&nbsp;&nbsp; def render(self):<br>&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; ....<br>&nbsp;&nbsp; -- return u'\n'.join([viewlet.render() for viewlet in self.viewlets])<br>&nbsp; ++ return u'\n'.join([viewlet.render() for viewlet in self.viewlets <span style="font-weight: bold;">if viewlet.available()</span>])<br><br>and adding the available method to Viewlet:<br><br>class Viewlet(ViewletBase):<br>&nbsp;&nbsp;&nbsp; ...<br><br>&nbsp;&nbsp;&nbsp;
 <span style="font-weight: bold;">def available(self):</span><br style="font-weight: bold;"><span style="font-weight: bold;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return True</span><br></div></body></html>