[Zope] METAL macros

jmabbate jmabbate@directvinternet.com
Mon, 7 Oct 2002 23:04:22 -0400


Hi,

I'm trying to create a split heading on all my pages. In plain
HTML, it would look something like this

               <h1>Site Name<br />
      <span class="tl">Tag line</span></h1>

The purpose of doing this is that I want to control both the
fonts and the spacing of the lines, via a CSS stylesheet (if I
use a <h1><h2> or similar combination, the lines are too far
apart).

So I created a 'master' page template with the following macro:

  <h1 metal:define-macro="heading">
  <span tal:content="template/sitename">Title</span><br />
  <span tal:content="template/tagline" class="tl">Tagline</span>
  </h1>

If I test this template, it looks exactly the way I want it. So
I tried to use it in another template as follows:

  <h1 metal:use-macro="root/master/macros/heading">Title and
Tagline</h1>

Unfortunately, when I try to test it, I get this not very helpful
message ...

  Site Error

  An error was encountered while publishing this resource. 

  Undefined

I've been using Zope for about a month so the traceback
information still looks like gobbledygook to me. I tried the
following variation:

  <h1 metal:use-macro="root/master/macros/heading">Title<br />
  <span tal:content="root/master/tagline">Tagline</span></h1>

but that still gives the same error. At this point, I don't know
if I'm doing something wrong or if this is something that is not
supported by the current implementation.

Any suggestions or comments will be welcome.

Joe