[Zope3-dev] Testing for a view

Casey Duncan casey@zope.com
Tue, 4 Mar 2003 16:06:08 -0500


On Tuesday 04 March 2003 03:24 pm, Sidnei da Silva wrote:
> Howdy,
>=20
> I just stumbled on a small thing that I think that could be easily
> fixed, but I dont know if everyone would agree on this. Heres the
> issue:
>=20
> Currently, the metadata box on is rendered using a view for
> dublincore. This view can be accessed using @@MetaDataBox.=20
>=20
> When testing for inclusion of the metadata box, the Z3 UI right now
> tests does this:
>=20
> ....=20
>      tal:define=3D"view context/@@MetaDataBox"
>      tal:condition=3D"view">
> ....
>=20
> But theres a small problem in here. The metadata box is a page
> template with a few conditions and if all those conditions evaluate to
> false, this view will not return an empty string, but a string that
> contains only spaces. From the Browser POV, a string that only
> contains spaces is not very useful so, I propose:

Couldn't you just use:

tal:condition=3D"view/strip"

To make a string that is all spaces evaluate false?

-Casey