RE: [Zope] Can one nest macros with slots?

2006-01-26 Thread Doyon, Jean-Francois
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:

main_template:


  <... some html ...>
  
  <... some html ...>


shared template:


  

  <... some html ...>
  
  <... 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 :(

Thanks!
J.F.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of J
Cameron Cooper
Sent: January 26, 2006 12:52 AM
To: Doyon, Jean-Francois
Cc: zope@zope.org
Subject: Re: [Zope] Can one nest macros with slots?

Doyon, Jean-Francois wrote:
> I can't seem to do this:
> 
> 
>   
> 
>   <... Some html ...>
>   
>   <... Some html ...>
> 
>   
> 
> 
> 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::

   here/main_template/macros/master

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.

--jcc

--
Building Websites with Plone
http://plonebook.packtpub.com/
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Can one nest macros with slots?

2006-01-25 Thread J Cameron Cooper

Doyon, Jean-Francois wrote:

I can't seem to do this:


  

  <... Some html ...>
  
  <... Some html ...>

  


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::


  here/main_template/macros/master

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.


--jcc

--
Building Websites with Plone
http://plonebook.packtpub.com/
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )