[Grok-dev] 'megrok.navigation': Adding two 'index' views
Bahman Movaqar
Bahman at BahmanM.com
Wed May 22 04:01:31 UTC 2013
Hi all,
Originally posted on StackOverflow
(http://stackoverflow.com/questions/16662293/megrok-navigation-adding-two-index-views)
I'm using `megrok.navigation'. Is it possible to add two |index| views
as `|sitemenuitem|'?
Consider the following case:
|### app.py
class Index(grok.View):
navigation.sitemenuitem(IMainMenu, u'Home', order=-1)
### mycontainer.py
# this is the default view for 'MyContainer' container
class MyContainerIndex(grok.View):
grok.context(MyContainer)
grok.name('index')
navigation.sitemenuitem(IMainMenu, u'My Container', order=0)|
When I try to run that I get the following error:
|zope.configuration.config.ConfigurationConflictError: Conflicting configuration actions
For: ('viewlet', None, <InterfaceClass zope.publisher.interfaces.browser.IDefaultBrowserLayer>, <InterfaceClass zope.browser.interfaces.IBrowserView>, <InterfaceClass myapp.menu.IMainMenu>, 'index')
File "/home/bahman/Work/myapp/src/myapp/configure.zcml", line 5.2-5.27
<grok:grok package="." />
File "/home/bahman/Work/myapp/src/myapp/configure.zcml", line 5.2-5.27
<grok:grok package="." />
|
Apparently, one cannot have two views with the same name (even with
/different/ contexts) on the navigation menu. Am I doing anything wrong?
TIA,
--
Bahman Movaqar (http://BahmanM.com)
ERP Evaluation, Implementation, Deployment Consultant
More information about the Grok-dev
mailing list