[Zope-CMF] [dev] more add menu changes

Martin Aspeli optilude at gmx.net
Thu Aug 7 12:09:33 EDT 2008


Hi Yuppie,



yuppie-4 wrote:
> 
> Hi!
> 
> 
> We now have to support two ways to add content:
> 
> 
> 1.) oldstyle (no add view specified)
> ------------------------------------
> 
> The addable types are listed in folder_factories. After specifying type 
> and ID the object is added. constructContent redirects to the immediate 
> view.
> 
> 
> 2.) newstyle (add view is specified)
> ------------------------------------
> 
> The addable types are listed as actions. These actions should show up in 
> a menu. The add action points to a type specific add form. After 
> completion of the form the object is added. The add form redirects to 
> the immediate view.
> 
> Some parts are still missing:
> 
> - add a traverser that allows to use pretty URLs and better portal type 
> handling for add views (not part of this proposal)
> 
> - don't show newstyle types in folder_factories
> 
> - show add actions in the CMFDefault skin
> 
> 
> Proposal 1: allowedContentTypes
> -------------------------------
> 
> This PortalFolder method is used by folder_factories and by 
> folder_contents to decide if the 'New...' button is added. I propose to 
> add a new skip_add_views argument to allowedContentTypes. If true, 
> newstyle types are skipped.
> 

Please let this default to False. I wonder if it's better to have a separate
method that does the skipping. allowedContentTypes may be used by other
things already. Plone uses it in a few places, for example. :)

I don't suppose there's a way to make all FTI's expose actions, and just
construct an appropriate fallback URL (e.g. createObject or whatever) if no
add view has been specified? That'd mean folder_factories could just loop
through the actions.



> Proposal 2: main_template
> -------------------------
> 
> CMFDefault menus are implemented in main_template. I propose to add a 
> new section for 'folder/add' actions.
> 
> 
> If there are no objections I'll make these changes on trunk.
> 

+0 - Plone would need this in its content menu implementation, but that's
custom anyway.

Martin
-- 
View this message in context: http://www.nabble.com/-dev--more-add-menu-changes-tp18867664p18873994.html
Sent from the Zope - CMF list2 mailing list archive at Nabble.com.



More information about the Zope-CMF mailing list