Hi Andreas

> Betreff: [Zope3-Users] When should I use z3c.macroviewlet?
> Hei all Zopers,
> I try to catch up with all the latest best practices on 
> writing skins and templates for Zope 3 - e.g. transforming 
> from metal macros based templates to viewlets, pagelets, 
> layout templates and content templates (the Z3C way of doing it). 
> All this looks very nice! But there is one new kid on the 
> block that I don't grasp: z3c.macroviewlets.
> I do understand that I can use the ZCML directive to extract 
> a viewlet from a defined macro in a page template, but is'nt 
> this exactly the same I can archive with z3c.template? 
> The only difference I can see is that with z3c.template I 
> will need two directives to archive this; one for the viewlet 
> (e.g. <browser:viewlet ... ) and one for the template (e.g. 
> <z3c.template ... ). With z3c.macroviewlet I can do the same 
> with one directive (e.g.
> <z3c.macroViewlet ... )
> So in which use cases are z3c.macroviewlet the best option?

The idea behind the macroviewlet is the option to let you 
define only one page template. The macroviewlet allows you 
to register snippets from this template and the same template 
could be used as layout template. This means you could really 
support an XHTML template with the full layout including all 
viewlets in it.

The main goal was to use the nice templates from the graphic 
desingers without any additional templates. 

z3c.macroviewlet allows you to define the layout and content
part in only one single page template file.

It's also possible to configure the layout, viewlet and content
part from a single page template file if you use z3c.template,
z3c.macro, z3c.macroviewlet. This should make it easy to add
additional macro slots to existing page templates from graphic 
desingers without to distroy their work and use them as z3c
macro and template components.

Roger Ineichen

> Best regards,
> Andreas
> _______________________________________________
> Zope3-users mailing list
> Zope3-users@zope.org
> http://mail.zope.org/mailman/listinfo/zope3-users

Zope3-users mailing list

Reply via email to