[Zope-CMF] Re: Moving to browser views
Charlie Clark
charlie at begeistert.org
Wed Jul 18 16:22:49 EDT 2007
Am 18.07.2007 um 22:07 schrieb Rob Miller:
> 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.
Okay, thanks! I'm nearly there. I think. %-? ;-)
Because I'm only creating essentially a slightly different view of an
event I've taken the ZCML for the standard view as a lead:
<browser:page
for="Products.CMFCalendar.interfaces.IEvent"
layer="Products.CMFDefault.interfaces.ICMFDefaultSkin"
name="event_iCal_view"
class=".event.EventiCalView"
permission="zope2.View"
/>
is event_iCal_view my view class?
So, let's say I need to turn my creation date into
20030127T090000Z
I can call this in my view class via
self.startdate = self.context.CreationDate()
and call this in my template via
view/startdate?
Charlie
--
Charlie Clark
Helmholtzstr. 20
Düsseldorf
D- 40215
Tel: +49-211-938-5360
GSM: +49-178-782-6226
More information about the Zope-CMF
mailing list