Re: [Zope3-Users] Replacing Macros with Contentprovider
On Friday 08 September 2006 19:19, [EMAIL PROTECTED] wrote: > Thanks for your reply. So, when you say macros still > excel for general O-wrap, do you mean things like > style_slot, script_slot and body_slot or do you also > include things like header_slot, navigation_slot, > breadcrumb_slot and footer_slot as well? We only use the body slot. Style, scrpting, header, navigation, breadcrumb and footer are all content providers. Basically, we use the main template to organize the set of all content providers. But as I am writing this I am chatting with Juergen Kartnaller that our new project will be 100% content providers/viewlet managers/viewlets. Since I am not working on this myself, I have no clue about the details, but I am going to see Juergen next week, so ping me or him then again. :-) > I'm a little confused as to whether render() from > contentprovider must only provide a string or if a zpt > can be used? All that the render() method is required to do is to return a string. How this string is created is up to the implementation. Of course, we are often using templates of the form: class ContentProvider(...): template = ViewPageTemplateFile('template.pt') def render(self): return self.template() > If a zpt can be used, does the namepace "view" access > the contentprovider object or the __parent__ view > object? Is the namespace "context" available as the > original object? Yep, yep. view -> is the ContentProvider instance as seen above. context -> is the regular context that is also the context of the view __parent__ -> The view object Regards, Stephan -- Stephan Richter CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student) Web2k - Web Software Design, Development and Training ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] your questions => KPUG wiki
First, thanks to all the z3-experienced people who answer beginners' questions here, and particularly to Stephan Richter who answered my own ones. I have added his answers on the kpug wiki. May I suggest that all people asking something on the list also spend a few minutes to copy-paste their questions/answers on the wiki too? http://kpug.zwiki.org/Zope3Faq (I chose this one because it seemed the most recent, but feel free to propose and to fill another one). This would probably avoid the same questions to be asked several times on the list (I realized too late that my question about the workflow had been asked at least twice before), and will help people to find recurrent and fresh information about z3. regards, Christophe ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Books example
Am Freitag, 8. September 2006 09:03 schrieb Sébastien VINOT: > Hello, > > I'm using both books to learn Zope3 : > - Web component Development with Zope 3 (Philipp Von Weitershausen) The home page of this book is at http://worldcookery.com/ > - Zope 3 (Stephan Ritcher) http://www.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/Zope3Book but I don't know if it's in sync with the printed version. > > I read somewhere that examples are updated somewhere on the web but I > can't find out where (I have to admit I did not dig into the second at > the moment). Does someone know where example are available ? Regards, florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Re: Replacing Macros with Contentprovider
Stephan Richter wrote: class ContentProvider(...): template = ViewPageTemplateFile('template.pt') def render(self): return self.template() Or even shorter: render = ViewPageTemplateFile('template.pt') :) ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Re: Books example
Sébastien VINOT wrote: Hello, I'm using both books to learn Zope3 : - Web component Development with Zope 3 (Philipp Von Weitershausen) - Zope 3 (Stephan Ritcher) I read somewhere that examples are updated somewhere on the web but I can't find out where (I have to admit I did not dig into the second at the moment). Does someone know where example are available ? There will be a second edition of my book available later this year at which point I will also provide a new set of examples. Philipp ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Re: Books example
Philipp, Regarding this subject... When I try the examples from chapter 7 in your book, I get the following error, when I try to add a Recipe. I simple can't figure out, how to resolve it. Any suggestions? I'm using Zope 3.2.1 Regards, Kim --- Traceback (innermost last): Module zope.publisher.publish, line 138, in publish result = publication.callObject(request, object) Module zope.app.publication.zopepublication, line 161, in callObject return mapply(ob, request.getPositionalArguments(), request) Module zope.publisher.publish, line 113, in mapply return debug_call(object, args) - __traceback_info__: > Module zope.publisher.publish, line 119, in debug_call return object(*args) Module zope.app.container.browser.adding, line 128, in action name=view_name) is not None: Module zope.component, line 165, in queryMultiAdapter return sitemanager.queryMultiAdapter(objects, interface, name, default) Module zope.component.site, line 75, in queryMultiAdapter default) Module zope.interface.adapter, line 475, in queryMultiAdapter return factory(*objects) Module zope.app.form.browser.editview, line 64, in __init__ self._setUpWidgets() Module zope.app.form.browser.add, line 49, in _setUpWidgets setUpWidgets(self, self.schema, IInputWidget, names=self.fieldNames) Module zope.app.form.utility, line 153, in setUpWidgets context=context) Module zope.app.form.utility, line 101, in setUpWidget widget = widget(field.bind(context), view.request) Module zope.app.form, line 120, in __call__ return self._create(args) Module zope.app.form, line 102, in _create instance = self._widget_factory(*args) TypeError: __init__() takes exactly 3 arguments (4 given) > -Oprindelig meddelelse- > Fra: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] På vegne af Philipp von > Weitershausen > Sendt: 10. september 2006 00:28 > Til: zope3-users@zope.org > Emne: [Zope3-Users] Re: Books example > > Sébastien VINOT wrote: > > Hello, > > > > I'm using both books to learn Zope3 : > > - Web component Development with Zope 3 (Philipp Von Weitershausen) > > - Zope 3 (Stephan Ritcher) > > > > I read somewhere that examples are updated somewhere on the > web but I > > can't find out where (I have to admit I did not dig into > the second at > > the moment). Does someone know where example are available ? > > There will be a second edition of my book available later > this year at which point I will also provide a new set of examples. > > Philipp > > ___ > Zope3-users mailing list > Zope3-users@zope.org > http://mail.zope.org/mailman/listinfo/zope3-users > > > ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users