[Zope3-dev] Products: Contents View Tab?
Eckart Hertzler
hertzler.eckart at guj.de
Wed Apr 28 11:23:44 EDT 2004
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Wednesday 28 April 2004 16:25, Ian Beatty is believed to have said:
> Greetings.
>
> I hope this is the right forum to post in. I'm trying to get my mind around
> product development for Zope 3, and I've run into a bit of a sticking
> point. I want to build a content class ('Roster') that's a container
> (subclass of BTreeContainer). I've defined an interface ('IRoster') for it
> (subclass of IContainer).
>
> So I'm trying to add a "Contents" tab to the class' ZMI interface. If I do
> it the way that the "Tutorial for Python Programmers" ('short.pdf')
> suggests, with the 'browser:containerViews' in my configure.zcml file, it
> works -- but I don't know how to have the tab's label be something other
> than the default "Contents".
>
The "browser:containerView" directive is an easy way to produce standard
views, and no more. So it is not intenden to do a lot of customization other
than the permission setting.
> On the other hand, if I follow the Cookbook (p.118) and use the
> 'browser:menuItem' tag, I get an error when clicking on an instance of the
> class in a parent's contents view in the ZMI: NotFoundError, "Error object:
> (, u'contents.html')". It bothers me that the Cookbook's recipe doesn't
> seem to work. Is the Cookbook obsolete?
It is not obsolete but rather out of sync.
There were a lot of changes affecting the cookbook recipes.
Now, using a "browser:menuItem" directives only works, if there exists a view
with the name ("contents.html"). If you don't define a contents view through
another directive, you won't be able to add it to a menu.
>
> On yet another hand, if I follow the Zope 3 Developer's Tutorial ("Step 8:
> Zope Container Framework") and use the 'browser:page' tag, I seem to get
> the tab I want with the name I want. It works, though I can't say I
> understand why.
With the "browser:page" directive you create a contents view and can also add
it to a menu.
>
> So I have a solution to my problem, but it's pretty much black magic to me
> why one approach works and the other two don't. That's not a happy place
> for a developer to be. Can anyone share a little enlightenment?
>
I stumbled on this as well ...
More information on the default contents view can be found in the
zope.app.container.browser package.
Regards,
Eckart
> Thanks,
>
> ..Ian
>
> -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- --
> Dr. Ian Beatty beatty at physics.umass.edu
> Physics Education Research voice: 413.545.9483
> Department of Physics fax: 413.545.4884
> Univ. of Massachusetts AIM: (available upon request)
> Amherst, MA 01003-9337 USA http://umperg.physics.umass.edu/
> -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- --
>
>
>
> _______________________________________________
> Zope3-dev mailing list
> Zope3-dev at zope.org
> Unsub: http://mail.zope.org/mailman/options/zope3-dev/eckart%40hertzler.de
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iD8DBQFAj8yEhG4SSzcwNxgRAr2JAKDFwPaLXWlC2x4UOv4EIQNqCM3HGwCZAaD6
x8sfOJNh5tPv7XxKj9tyrxs=
=+GD7
-----END PGP SIGNATURE-----
More information about the Zope3-dev
mailing list