[Zope-CMF] buidling skin namespaces with folders
Janko Hauser
janko at need-brain.de
Sun Dec 7 13:49:49 EST 2003
On Sun, 7 Dec 2003 19:04:52 +0100
Dieter Maurer <dieter at handshake.de> wrote:
> Janko Hauser wrote at 2003-12-6 21:22 +0100:
> >we want to have a stronger separation of templates in the skin
> >machinerie. To do that, we put them into subdirectories in the
> >filesystem, which are not directly mapped in the skin-layer.
> >
> >To get such a template we use
> >
> >mainview.setView(self,
> > self._context.ucimage.image_view, 'defaultView')
>
> The skins machinery does not support this use case...
> Do not try!
>
Thanks Dieter for confirmation, it was a surprise.
> > ...
> >Later on we want to introduce a controller, but he also needs to
> >solve the same problem.
> Go this route right away.
>
> When you use your controller in this way:
>
> <URL_to_object>/Controller/<path_to_template>
>
> then the controller can save its parent and ensure (by acquisition
> rebindung) that the template is called with the correct object
> as "here".
>
Found this way, by remembering old DTML-tricks.
obj = getattr(view.aq_parent, obj.getId())
view = getattr(obj, view.getId())
result = view(view=pagecontext)
just for illustration, as I must now differentiate in the parent
lookup between DirectoryViews and normal objects. This won't be
needed, if the controller is given an explizit path.
Thanks again,
__Janko
More information about the Zope-CMF
mailing list