[Zope-CMF] Hidden Actions?

Florent Guillaume fg@nuxeo.com
16 Aug 2001 10:40:32 GMT


Jon Edwards <jon@pcgs.freeserve.co.uk> 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?

If I understand your problem, you could create a DTML Method called
list_view in the skin, containing something like:

<dtml-let m=meta_type>
 <dtml-if "m == 'Document'">
  <dtml-var document_list_view>
 <dtml-elif "m == 'Image'">
  <dtml-var image_list_view>
 <dtml-else>
  <dtml-var default_list_view>
 </dtml-if>
</dtml-let>

Not very pretty but it should work...


Florent Guillaume
Nuxeo