[Zope-CMF] Detecting if object is "repliable"

davelehman@loewen.com davelehman@loewen.com
Mon, 17 Sep 2001 17:04:34 -0500


I'm re-working the "view" methods for several content type in my portal.

I want to have a "reply" button show up at the bottom of the content, if
the type is "discussable", and the user has rights to it.

So looking at "actions_box" in portal_skins, i've got to do something like
this:

<dtml-let isAnon="portal_membership.isAnonymousUser()"
          AuthClass="isAnon and 'GuestActions' or 'MemberActions'"
          uname="isAnon and 'Guest'
                 or portal_membership.getAuthenticatedMember().getUserName
()"
          obj="this()"
          actions="portal_actions.listFilteredActionsFor(obj)"
          user_actions="actions['user']"
          folder_actions="actions['folder']"
          object_actions="actions['object'] + actions['workflow']"
          global_actions="actions['global']"
>
  <dtml-in object_actions mapping>
    <dtml-if expr="object_name == 'Reply'">
      SHOW REPLY BUTTON
    </dtml-if>
  </dtml-in>
</dtml-let>

I don't understand what should go in the <dtml-if> expression. Can someone
lend me a quick hand?

Regards,
Dave