[ZPT] eliminated path expressions .. again

Ulrich Eck ueck@net-labs.de
Wed, 30 May 2001 12:57:07 +0200


hi out there,

I want to include macros depending on the meta_type of the current object.

there is a folder chrome/standard where all the page-templates stored named
equal to the meta_types I use (each defines several macros, e.g. "view").

e.g.
/myapp
 |- chrome
     |-standard
         |-Folder
         |-ImapFolder
         |-ImapMessage

I tried to use path expressions from python to get the right PageTemplate
and it would be
nice to have "nocall" or "trailing slash/" capabilities in path-expressions
to get this working.

my attempt was:
--------------------------------------------------------------------------
<html xmlns:tal="http://xml.zope.org/namespaces/tal"
      xmlns:metal="http://xml.zope.org/namespaces/metal"
      metal:use-macro="here/chrome/standard/master/macros/master">
 <body>
  <div metal:fill-slot="main">
    <h3>ImapClient Main</h3><br><br>
    <div metal:use-macro="python:path('here/chrome/standard/' +
here.meta_type).macros['view']"/>
  </div>
 </body>
</html>

----------------------------------------------------------------------------
-

but i get back a html-structure not an object when using path-expressions
... hmmmm

I could do weird things in python with getattr an suchalike but this would
be very simple
when having access to the object not the value of a path-expression.

I'ld really like to see nocall or trailing-slash back in the next release
(please ;-)

Is there another way to do this in a simple way ??

thanks for any hint

Ulrich Eck
net-labs