Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Zope: CMF

Error with a macros object

 

 

Zope cmf RSS feed   Index | Next | Previous | View Threaded


charlie at begeistert

Nov 24, 2009, 7:05 AM

Post #1 of 3 (696 views)
Permalink
Error with a macros object

Hi,

I've just got the following error on a macros page:

_macros' object has no attribute 'index'

Where the metal is

<html metal:use-macro="context/@@new_macros/page">

original template is

<metal:macro metal:define-macro="page"
> <html metal:use-macro="context/main_template/macros/master">
<head>
<metal:slot metal:fill-slot="style_slot"
> <metal:slot metal:define-slot="style_slot" /></metal:slot>
</head>
<body>
<metal:slot metal:fill-slot="body"
> <metal:slot metal:define-slot="body"/></metal:slot>
</body>
</html></metal:macro>

And the macros configured as a subclass from Five's standardmacros.Macros
class

Having just upgraded from Zope 2.11 and CMF 2.1+ there are a lot of places
to look

As the template itself is registered as a view then I can workaround the
problem with

<html metal:use-macro="context/base_template/page">

But would appreciate any pointers in the right direction.

Charlie
--
Charlie Clark
Managing Director
Clark Consulting & Research
German Office
Helmholtzstr. 20
Düsseldorf
D- 40215
Tel: +49-211-600-3657
Mobile: +49-178-782-6226
_______________________________________________
Zope-CMF maillist - Zope-CMF [at] zope
https://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


charlie at begeistert

Nov 29, 2009, 6:56 AM

Post #2 of 3 (642 views)
Permalink
Re: Error with a macros object [In reply to]

Am 24.11.2009, 16:05 Uhr, schrieb Charlie Clark <charlie [at] begeistert>:

> Hi,
> I've just got the following error on a macros page:
> _macros' object has no attribute 'index'

I think I've traced the source of the error. In
Products.Five.browser.metaconfigure there is the following mixin and the
key access is understandbly raising the error.

class ViewMixinForTemplates(BrowserView):
# Cloned from zope.app.pagetemplate.simpleviewclass.simple
implements(IBrowserPublisher)

def browserDefault(self, request):
return self, ()

def publishTraverse(self, request, name):
if name == 'index.html':
return self.index

raise NotFound(self, name, request)

def __getitem__(self, name):
return self.index.macros[name]

def __call__(self, *args, **kw):
return self.index(*args, **kw)

Where is the "index" defined? I can't find it in IBrowserView or
IBrowserPublisher?

Charlie
--
Charlie Clark
Helmholtzstr. 20
Düsseldorf
D- 40215
Tel: +49-211-938-5360
GSM: +49-178-782-6226
_______________________________________________
Zope-CMF maillist - Zope-CMF [at] zope
https://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


charlie at begeistert

Nov 29, 2009, 8:16 AM

Post #3 of 3 (636 views)
Permalink
Re: Error with a macros object [In reply to]

Am 29.11.2009, 15:56 Uhr, schrieb Charlie Clark <charlie [at] begeistert>:

> I think I've traced the source of the error. In
> Products.Five.browser.metaconfigure there is the following mixin and the
> key access is understandbly raising the error.

Phew, I've solved the problem:

Macro configuration has changed from a browser:view to a browser:page
directive.

from

<browser:view
for="*"
name="standard_macros"
permission="zope2.View"
class=".standardmacros.StandardMacros"
allowed_interface="zope.interface.common.mapping.IItemMapping"
/>

to

<browser:page
for="*"
name="standard_macros"
permission="zope2.View"
class=".standardmacros.StandardMacros"
allowed_interface="zope.interface.common.mapping.IItemMapping"
/>

Charlie
--
Charlie Clark
Helmholtzstr. 20
Düsseldorf
D- 40215
Tel: +49-211-938-5360
GSM: +49-178-782-6226
_______________________________________________
Zope-CMF maillist - Zope-CMF [at] zope
https://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests

Zope cmf RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.