[Zope-CMF] Hidden Actions?

Tres Seaver tseaver@palladion.com
Thu, 16 Aug 2001 10:26:41 -0400


Jon Edwards wrote:

> To help building composite pages, I want to create (at least) 3 different
> "views" of all content-objects that can be called by the code for the
> composite -
> 
> list_view    (shows the title as a hyperlink to the object)
> summary_view (as above, plus the description)
> page_view    (similar to the normal view, but without the header and footer)
> 
> I could do this with Python I guess (similar to CookedBody), but I want them
> to be DTML methods in portal_skins, so that they can be more easily
> customised.
> 
> So, I thought I'd use the Types Tool, and add them as Actions for each
> content-type, with a pointer to the method for that particular type
> (document_list_view, image_list_view, and so on). That way I can do
> something like -
> 
> <dtml-in catalog-search-that-finds-lots-of-different-objects>
> <dtml-var list_view>
> </dtml-in>
> 
> But, if I add them as Actions, they're going to show up in the actions_box,
> which is going to get very cluttered and confusing. So, is there a way to
> add Actions, but "hide" them from the actions_box? Or a better way to do
> this?

Current CVS for the TypesTool actually adds a "Visible" checkbox to
each action, for exactly that purpose.  Your DTML would have to
look like this, though:

  <dtml-in catalog-search-that-finds-lots-of-different-objects>
  <dtml-let method_name="getTypeInfo().getActionById( 'list_view' )">
   <dtml-var expr="_[ method_name ]">
  </dtml-let>
  </dtml-in>

Tres.
-- 
===============================================================
Tres Seaver                                tseaver@zope.com
Zope Corporation      "Zope Dealers"       http://www.zope.com