Silva 2.0/SilvaLayout: Problem with public preview

"Luthiger Stoll Benno" <[email protected]> Tue, 31 Jul 2007 15:43:45 +0200
Newsgroups gmane.comp.web.zope.silva.devel
Message-ID <[email protected]>
Hello

Playing around with a new layout based on Silva 2.0 and SilvaLayout, I'm struggling with the public preview (i.e. the preview of the nonpublished content in the look of my own layout).
When I click on the 'preview' button, I get a TraversalError thrown by the system's lookup for the main macro.
I figured out that the PageTemplate SilvaLayout/browser/silvadefault/publicpreview.pt is called. In this PageTemplate, there's the following statement:
===
<tal:block metal:use-macro="context/index.html/main">
===
This statement looks for the main macro in the index.html defined in my layout and throws the aforementioned error if no such macro is defined.
If I change my PageTemplate and add the macro definition, no error is thrown. However, my layout is displayed with the message "Sorry, this Silva Document is not viewable".

I have the impression that somehow the PageTemplate SilvaLayout/browser/silvadefault/maintemplate.pt has to be called instead. How can this be achieved? Do I have to register something I missed?

Regards,
Benno


The traceback:
===
Traceback (innermost last):
  Module ZPublisher.Publish, line 119, in publish
  Module ZPublisher.mapply, line 88, in mapply
  Module ZPublisher.Publish, line 42, in call_object
  Module Products.Five.browser.metaconfigure, line 416, in __call__
  Module Shared.DC.Scripts.Bindings, line 313, in __call__
  Module Shared.DC.Scripts.Bindings, line 350, in _bindAndExec
  Module Products.PageTemplates.PageTemplateFile, line 129, in _exec
  Module Products.PageTemplates.PageTemplate, line 89, in pt_render
  Module zope.pagetemplate.pagetemplate, line 117, in pt_render
   - Warning: Macro expansion failed
   - Warning: zope.traversing.interfaces.TraversalError: (<Products.Five.metaclass.SimpleViewClass from C:\programs\Zope\Zope-2.10.3\Instances\Silva2.0\Products\MyLayout\index.pt object at 0x01DC0730>, 'main')
  Module zope.tal.talinterpreter, line 271, in __call__
  Module zope.tal.talinterpreter, line 346, in interpret
  Module zope.tal.talinterpreter, line 870, in do_useMacro
  Module zope.tales.tales, line 696, in evaluate
   - URL: index
   - Line 7, Column 0
   - Expression: <PathExpr standard:'context/index.html/main'>
   - Names:
      {'container': <Silva Document instance test1>,
       'context': <Silva Document instance test1>,
       'default': <object object at 0x00A6C528>,
       'here': <Silva Document instance test1>,
       'loop': {},
       'nothing': None,
       'options': {'args': (<Products.Five.metaclass.SimpleViewClass from C:\programs\Zope\Zope-2.10.3\Instances\Silva2.0\Products\SilvaLayout\browser\silvadefault\publicpreview.pt object at 0x0340DF10>,)},
       'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0x03404A30>,
       'request': <HTTPRequest, URL=http://localhost:8083/silva/my_sites/my_site/test1/preview_html>,
       'root': <Application at >,
       'template': <ImplicitAcquirerWrapper object at 0x01DC0630>,
       'traverse_subpath': [],
       'user': <User 'Luthiger'>,
       'view': <Products.Five.metaclass.SimpleViewClass from C:\programs\Zope\Zope-2.10.3\Instances\Silva2.0\Products\SilvaLayout\browser\silvadefault\publicpreview.pt object at 0x0340DF10>,
       'views': <zope.app.pagetemplate.viewpagetemplatefile.ViewMapper object at 0x01DC06F0>}
  Module zope.tales.expressions, line 217, in __call__
  Module Products.PageTemplates.Expressions, line 131, in _eval
  Module zope.tales.expressions, line 124, in _eval
  Module Products.PageTemplates.Expressions, line 83, in boboAwareZopeTraverse
  Module zope.traversing.adapters, line 164, in traversePathElement
   - __traceback_info__: (<Products.Five.metaclass.SimpleViewClass from C:\programs\Zope\Zope-2.10.3\Instances\Silva2.0\Products\MyLayout\index.pt object at 0x01DC0C90>, 'main')
  Module zope.traversing.adapters, line 52, in traverse
   - __traceback_info__: (<Products.Five.metaclass.SimpleViewClass from C:\programs\Zope\Zope-2.10.3\Instances\Silva2.0\Products\MyLayout\index.pt object at 0x01DC0C90>, 'main', [])
TraversalError: (<Products.Five.metaclass.SimpleViewClass from C:\programs\Zope\Zope-2.10.3\Instances\Silva2.0\Products\MyLayout\index.pt object at 0x01DC0C90>, 'main')