[Neos] Creating a ContentCollection same way as any other content

Christian Müller christian.mueller at typo3.org
Fri Jun 6 09:12:03 CEST 2014


Hello Stefan,

Stefan Reichelt wrote:
> Hello there,
>
> does anybody know a way to dynamically create a ContentCollection on a
> page node the same way as any other content node like headline or text?
> Is is even technically possible?

Currently at least neither implemented nor tested. But the API won't 
prevent it, so creating a custom edit view with a form to add content 
collections to a page

>
> I tried to change the nodetype this way through a custom package:
> 'TYPO3.Neos:ContentCollection':
>    superTypes: ['TYPO3.Neos:Content']
>    ui:
>      group: 'structure'
>    properties:
>      _name:
>        type: string
>        ui:
>          label: 'Name'
>          reloadIfChanged: TRUE
>          inspector:
>            group: 'type'
>        validation:
>          'TYPO3.Neos/Validation/NotEmptyValidator': []
>          'TYPO3.Neos/Validation/StringLengthValidator':
>            minimum: 1
>            maximum: 255
>          regularExpression:
>            regularExpression: '/^[a-z0-9\-]+$/i'
>
> Having Content as supertype I could at least create a ContentCollection
> through the 'Create new' button. I added '_name to properties so I could
> change its name to something more simpler than the random 'nodeSomeNumbers'.
>
> However I was unable to use a ContentCollection created in such a way:

Yep, I think defining it as Content has several side effects. First it 
will then get a default TypoScript prototype of Content. That could be 
fixed but I guess also the metadata generated won't be compatible right now.
Might be something possible in the future.


> Also on a site note:
> When creating a new page node, you can directly input a name for that
> page inside of the pages nodetree.
> Could this feature also be possible for content nodes in their tree?

Yes, from a technical perspective nothing speaks against that, but could 
you tell me your use case for that?

Cheers,
Christian

-- 
Christian Müller
Flow / Neos Team Community Contact

TYPO3 .... inspiring people to share!
Get involved: http://typo3.org




More information about the Neos mailing list