[Zope] Question about the default view of a ZClass named index_html
Michiel Toneman
michiel@apenstaartje.nl
Tue, 14 Aug 2001 00:47:58 +0200 (CEST)
On Mon, 13 Aug 2001, Dieter Maurer wrote:
> Michiel Toneman writes:
> > ...
> > If I call it index_html, the following URLs get me a zero sized reply =
of
> > mime-type text/x-unknown-content-type.=20
> >=20
> > http://server/MyFolder/
> > http://server/MyFolder/index_html
> >=20
> > However, I can use the object as=20
> >=20
> > http://server/MyFolder/index_html/index_html
> This is an effect of the following ZPublisher code
> (from "ZPublisher.BaseRequest.BaseRequest.traverse"):
> # Check for method:
> if path:
> entry_name =3D path.pop()
> elif (method and hasattr(object,method)
> and entry_name !=3D method
> and getattr(object, method) is not None):
> request._hacked_path=3D1
> entry_name =3D method
>=20
> It explicitely checks for "entry_name !=3D method".
> This probably has the purpose to avoid infinite loops.
>=20
> In your case, "method" is "index_html".
>=20
Hi Dieter
Thanks for the explanation! I've tried the solution Geir B=E6kholt sent me
(inheriting from the Renderable-ZClass product) which worked like a charm :=
-)
I'd already started on a custom folderish ZClass to hack around the problem=
,
but now I only need a small adjustment to my original Product (i.e. there h=
as to
be a render method, which only calls "<dtml-var index_html>".
Thanks for your help!
Greetings,
Michiel Toneman
--=20
Anthony's Law of Force:
Don't force it; get a larger hammer.