Re: ContentWidget/ContentField idea

Martin Aspeli <[email protected]> Thu, 31 Aug 2006 05:06:43 -0700 (PDT)
Newsgroups gmane.comp.web.zope.plone.archetypes.devel
Message-ID <[email protected]>


Max M wrote:
> 
> I often need to populate a content type after its creation, but I think
> it would be nice if there was a standard way of doing this.
> 
> Often I also need to attach properties to a content type. It would be
> nice to reuse content types for this instead of making big changes to 
> products.
> 
> 
> So I have though of a new field/widget pair, and would like to get some
> feedback on the idea.
> 
> The basic idea is that a field can have a complex content type as a value.
> 
> E.g if I have an intranet content type, and I always want a 'news'
> folder for that content type, I would add a ContentField like this.
> 
> ContentField = (
>      'news',
>      required=0,
>      show_in_folder_listing = 1
>      is_frontpage = 1
>      widget = ContentWidget(
>          portal_type = 'Folder',
>          title='Site news',
>          description='This folder is for news items',
>          init_script = 'setupNewsfolder',
>      )
> )
> 
> The folder would then automatically be created in the content type. Just
> like ordinary fields and the 'init_script' would be run on it.
> 

It's not really a field, though is it? I mean, are you expecting users to
edit this field (how would it look?) on the edit tab and view it on the view
tab?

If what you want is a pluggable way of populating a folderish content type
when it's created, then I think you want events. Rocky just checked some
code in AT to make it easier to react to events when things are first saved.

Martin

-- 
View this message in context: http://www.nabble.com/ContentWidget-ContentField-idea-tf2196234.html#a6078088
Sent from the Archetypes - devel forum at Nabble.com.


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642