[Zope] Accessing properties

Loren Stafford lstaffor@dynalogic.com
Thu, 17 Feb 2000 18:50:58 -0800


Don't take anything I say literally 8^#

I can never remember how to call these things; maybe self is automatic, so
it's just ...

<dtml-if "hasProperty('hidden')">

Ah! Yes! Here's one from my site

<h3><dtml-if "hasProperty('Region')">
    <dtml-var Region>
    </dtml-if></h3>

-- Loren

> I get a NameError on 'self' when I use this. Is 'self' literal or am I
> reading your response wrong?
> I have <dtml-if "hasProperty(self, hidden)"> to look for my hidden
> property is this the right way to do it?

>  -- Roddy

> => 2. Try this (from the ZQR)
> =>
> =>     hasProperty(self, id)
> =>                 Return a true value if a property exists with the given
id.
> =>
> => -- Loren

> => > => <!-- Begin Title List -->
> => > => <ul>
> => > => <!--#in "PARENTS[0].objectValues(['Folder'])" sort=title
> => > => skip_unauthorized-->
> => > => <!--#unless noindex-->
> => > => <li><A HREF="<!--#var absolute_url-->"><!--#var
title_or_id--></A></li>
> => > => <!--#/unless-->
> => > => <!--#/in-->
> => > => </ul>
> => > => <!-- End Title List -->
> => >
> => > Thanks Loren, works fine, except for silly acquisition. If you are
viewing
> => > a page that has the property set to true acquisition says that the
> => > property is in the namespace. I don't want to have to set it to false
on
> => > every other folder, just true on those not to display in the index.
> => > What happens is if you view a folder that has the property set then
> => > nothing at all is displayed because it's not set to false anywhere
else
> => > and it's in the namespace stack as true!
> => > Other ideas?
> => >  -- Roddy