[Grok-dev] viewlets and application_root

Joachim Schmitz js at aixtraware.de
Wed Apr 23 12:50:47 EDT 2008


hi,

I am trying to build a navigation_tab_bar with a viewlet. This tab_bar 
should always show the keys of the root-application-object. Till now I have:

import grok
from zope import interface, schema

class Campus(grok.Application, grok.Container):
     def __init__(self):
         super(Campus, self).__init__()
         self['academics'] = Academics()
     pass

class TabBarManager(grok.ViewletManager):
     grok.name('tab_bar')
     grok.context(interface.Interface)

class TabBar(grok.Viewlet):
     grok.context(interface.Interface)
     grok.template('tab_bar')

     def update(self):
         pass
......



the tab_bar.pt looks like:
<div class="corner-page-top"></div>
<div class="navbar">
   <!-- Navigation items -->
   <ul tal:repeat="key python:context.keys()">
     <li><a tal:define="section python:context[key]"
            tal:attributes="href python:view.url(key)"
            tal:content="python:section.title"></a>
     </li>
   </ul>
   <!-- Navigation item -->
</div>

What do I have to put for context here to always show the keys of the 
application-root ?



-- 
Gruß Joachim


More information about the Grok-dev mailing list