[Zope3-Users] skin concepts

Frank Burkhardt fbo2 at gmx.net
Fri Mar 17 08:22:27 EST 2006


Hi,

On Fri, Mar 17, 2006 at 08:52:26AM +0100, Lorenzo Gil Sanchez wrote:

> I want to understand some concepts involved in skin development and I
> haven't found any resource to read about this. I noticed that there is
> no skin package inside the Zope codebase and so I couldn't find any
> README.txt file as in other packages.

Have a look at zope.app.rotterdam (deprecated AFAIK) and zope.app.boston.

[snip]

> So here are my questions:
> 
> - What is the default view that is applied to a content object? If I
> have something like this in my configure.zml:
> 
>   <page
>       for="mypackage.mycontenttype"
>       name="index.html"
>       permission="zope.View"
>       layer="mylayer"
>       template="index.pt"/>
> 
>  how do I make it the default view for objects of mycontenttype?

<defaultView
	for="mypackage.mycontenttype"
	name="index.html"
/>

>  Related question: what is the default view for the root object in a
> zope instance? I have seen how to configure the default skin in a
> configuration file inside /etc but I don't know how Zope knows what view
> to apply if none is provide explicitly in the URL

In this case the '<defaultView>' is used. The root object is just a
Folder - the default view is '@@index.html'. Just put an object
'index.html' into the root folder (or in any folder) to have it
shown by default.

> - What are the dialog_macros, view_macros, skin_macros and friends? I
> know that they are ZPT macros but how are they related? Which one is
> taken in each view?

A template is always a whole webpage - mo macro is applied magically.
You have to include macros explicitely:

<div metal:use-macro="context/@@[macro-view]/[macro]">
... my little template...
</div>

[macro-view] is the macro-package - e.g. standard_macros or view_macros.
You can define as much as you like by adding templated <page>-zcml
directives for your layer and marking them es macro packages.
(see zope.app.basicskin.standardmacros.StandardMacros.macro_pages)

> where is this wired? I've seen the basicskin package
> of the Zope codebase and the file standardmacros.py but I don't
> understand how it works.
> 
> - In my template.pt file I have defined a macro called 'page' and I just
> noticed that changing it to another name makes my template not being
> called. So I assume someone is doing something like <metal
> use-macro="page"> but I'm too curious to trust magic: I want to know how
> the internals of this mechanism work :)

AFAIK it's just a standard to use "page" to render a view as part of
a management interface and to use "view" to render it standalone.

Regards,

Frank


More information about the Zope3-users mailing list