The situation:

I have a "main_template" that does the looks of the site, with a "main" slot
where the content goes, much like the standard templates give you.

Now I have objects that behave similarly and share some interface
components, so I figured I could try to create another macro, with another
slot to fit inside that "main" slot, that all of the objects/content types
could re-use.

So I end up doing what I said below ... But that doesn't work :(

I've come up with an alternative for now, though it's not as elegant as this
I think ... But it'll have to do.

If you care to keep reading, the details:


  <... some html ...>
  <define-slot="main" />
  <... some html ...>

shared template:

      <... some html ...>
      <define-slot="sharedslot" />
      <... some html ...>

Object specific template:

  <... some html ...>

This works without errors, except that only the first macro "shared" comes
out, the "master" one never gets processed :( I would've expected this to be
recursive ... Ah well :(


-----Original Message-----
Cameron Cooper
Sent: January 26, 2006 12:52 AM
To: Doyon, Jean-Francois
Subject: Re: [Zope] Can one nest macros with slots?

Doyon, Jean-Francois wrote:
> I can't seem to do this:
> <use-macro>
>   <fill-slot>
>     <define-macro>
>       <... Some html ...>
>       <define-slot></define-slot>
>       <... Some html ...>
>     </define-macro>
>   </fill-slot>
> </use-macro>
> Allowing me to nest multiple reusable templates?
> I have objects with common interfaces which could easily share templates
> If I could do this! (The shared template still needs to endup in the 
> "master" template).
> Or are there other techniques to achieve this?

Macros are decided at compile time so that you can ask a template (which is
not called) for its macros::


The code above would have macros being created in some other template at the
time this macros is used, and I cannot imagine how they would be available.

Why is a macro with whatever uses your common interfaces not suitable? 
You scenario is too vague for any other advice.


Building Websites with Plone
Zope maillist  -
**   No cross posts or HTML encoding!  **
(Related lists - )
Zope maillist  -
**   No cross posts or HTML encoding!  **
(Related lists - )

Reply via email to