Re: [Zope3-Users] Beginner: Reference to ZPT macros

2008-01-27 Thread Stephan Richter
On Thursday 17 January 2008, Hermann Himmelbauer wrote:
 I personally don't like macros that much, therefore I prefer Stephan
 Richters pagelet/viewlet approach, which you can find in z3c.pagelet.

We need to give credit to Roger here. He came up with pagelets as a response 
for hating macros like you do and not liking a pure viewlet approach either. 
That said, I have to agree, I like the pagelet pattern a lot too and it works 
beautiful for your typical Web application.

Regards,
Stephan
-- 
Stephan Richter
Web Software Design, Development and Training
Google me. Zope Stephan Richter
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Beginner: Reference to ZPT macros

2008-01-16 Thread Hermann Himmelbauer
Am Mittwoch, 16. Januar 2008 19:27 schrieb Achim Domma:
 Hi,

 I have a simple view. Here is the entry in configure.zcml:

browser:page
for=.CMS.Page
name=index.html
class=.CMS.PageView
permission=zope.Public
template=index.pt
menu=zmi_views
title=Default View
/

 The view works fine so far, but now I want to use a template macro to
 implement a common layout. So I created a layout.pt in the same
 folder as index.pt. In index.pt I try to reference layout.pt like this:

 div xmlns:metal=http://xml.zope.org/namespaces/metal; metal:use-
 macro=context/@@layout.pt/macros/default_layout
  div metal:fill-slot=content
  div tal:content=structure view/html_content/div
  /div
 /div

 Now I get an TraversalError but I could not figure out why. How do I
 have to reference layout.pt? Do I have to register the emplate
 somehow? I work with Philips book, but he uses a template created via
 ZMI in his example.

Hav a look at skin/standardmacros.py in the worldcookery examples: There you 
can see the mechanism that allows other pages to access the macros.

I personally don't like macros that much, therefore I prefer Stephan Richters 
pagelet/viewlet approach, which you can find in z3c.pagelet.

Best Regards,
Hermann

-- 
[EMAIL PROTECTED]
GPG key ID: 299893C7 (on keyservers)
FP: 0124 2584 8809 EF2A DBF9  4902 64B4 D16B 2998 93C7
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users