[Zope3-dev] RE: views to traversers

Garrett Smith garrett@mojave-corp.com
Tue, 1 Jul 2003 22:04:40 -0500


Garrett Smith wrote:
> I have a class (e.g. Foo) that has two lists of components. I'm trying
to create two views, each of which can be used to traverse to items in a
respective list.
>=20
> E.g. an instance of Foo in the root folder would be accessed using:
>=20
>   /foo
>=20
> I want to be able to access items in each of foo's two lists using
something like:
>=20
>   /foo/list_1/a
>   /foo/list_1/b
>   /foo/list_1/c
>   /foo/list_2/a
>   /foo/list_2/b
>=20
> In this case, 'list_1' and 'list_2' are just views -- they don't
actually exist as components. This is similar to how standard_macros is
used -- but I can't get the IItemMapping pattern to work in this case.
>=20
> Is there a straight forward way to handle this?

Sorry, this is painfully easy -- dunno why I was running into problems
earlier :-/

For the record, this example calls for two pages for IFoo, named
'list_1' and 'list_2'. Each would use a class that implements
IBrowserPublisher. In each of the IBrowserPublisher classes,
publishTraverse would return components in the respective lists -- e.g.
'a', 'b', etc.

 -- Garrett