Charlie Clark wrote:
Hi,

I making my first stab at browser views for my iCal support having finally come up with some templates that seem to produce files that work with most calendar programs.

I have a couple of questions:
1) should I implement them as BrowserViews calling templates or should I use an adapter? The templates are TAL and the only difference to an HTML page is the different response header.

i think the most common idiom is to use <browser:page> directives, pointing at a BrowserView subclass, using either "template" or "attribute" within the directive to specify the action to take.

2) how do I pass in values derived specifically for these views? ie. going from
options = {}
options['name'] = charlie
...
return context.mytemplate(**options)

while it may be appropriate in some cases to pass values directly into the template like this, usually the template pulls the values from the view class. you can make "name" an attribute (or a property) of the view class, and then use the "view/name" TALES expression within the template.

-r

_______________________________________________
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests

Reply via email to