Re: developer-level changes Silva 1.2
Martijn Faassen <[email protected]>
| Newsgroups | gmane.comp.web.zope.silva.devel |
|---|---|
| Message-ID | <[email protected]> |
Benno Luthiger wrote:
> Hello
>
>
>> * instead of 2 scripts 'render_view' and 'render_preview' only
>> 'render' is called for both view and preview, if you want to
>> make a distinction between the two, you can register a new
>> view_type called 'preview' to another subdirectory and place a
>> 'render' script in that, the general pattern is that if you want
>> to use only 1 script you place it directly in the
>> 'public/<meta_type>' directory, if you want to have seperate
>> scripts for view and preview, create a 'view' and 'preview'
>> directory in that dir ('public/<meta_type>/view' and
>> 'public/<meta_type>/preview')
>
> For Silva extension developers this means that they have to register the
> public view for their object under ['public', 'MyObject', 'view'] instead of
> ['public', 'MyObject'], i.e.
> reg.register('public', 'My Object Version', ['public', 'MyObject', 'view'])
>
> and to register a preview in addition, i.e.
> reg.register('preview', 'My Object Version', ['public', 'MyObject',
> 'preview'])
Yes, that's correct. Note that the rendering python script should be
called 'render', there is no separate render_preview anymore.
I think if you do not register a separate preview there is a fallback to
the 'public' view, too, so it may not be necessary to register 'preview'.
Regards,
Martijn