[Neos] Put Text node as direct child on page

Dmitri Pisarev dimaip at gmail.com
Fri Mar 6 11:21:04 CET 2015


Hey Bernhard, it's really no rocket science :)
Just look at the source code of Neos TS objects.
nodePath is only available in ContentCollecion and all objects that extend
it (like PrimaryCollection):
https://git.typo3.org/Packages/TYPO3.Neos.git/blob/2d310ffc9de726460a1a6c7b698fbcc6c126a640:/Resources/Private/TypoScript/Prototypes/ContentCollection.ts2
And @override.node just overrides the node with which that Text object will
be rendered. See here:
https://git.typo3.org/Packages/TYPO3.Neos.NodeTypes.git/blob/HEAD:/Resources/Private/TypoScript/Root.ts2

On Fri, 6 Mar 2015 at 12:05 Bernhard Aster <bernhard.aster at arrabiata.de>
wrote:

> Hi Dmitri,
>
> thanks for your hint.
> Now it's working.
>
>
> page.content.teaser = TYPO3.Neos.NodeTypes:Text {
>   @override.node = ${q(documentNode).children('teaser').get(0)}
> }
>
> "Why nodePath?"
> I simply copied the page.content.main part and changed the type from
> PrimeryContent to TYPO3.Neos.NodeTypes:Text.
>
> page.content.main = PrimaryContent {
>   nodePath = 'main'
> }
>
> I thought with nodePath="teaser" i define the nodePath to "teaser" in the
> current context of a page node. Like "main" area.
>
> A.T.M i don't got it at all why @override.node works. But i will study
> that.
>
> Thanks anyway
> Best Bernhard
>
> Quote: Reinis Zumbergs (reinis-zumbergs) wrote on Mon, 26 January 2015
> 12:30
> ----------------------------------------------------
> > Hello, all, my first post here!
> >
> > We all know how to put ContentCollection on the page:
> >  - add new childnode in NodeTypes.yaml
> >  - add ContentCollection sub-path to body parts in Root.ts2
> >
> > But I would like to put TYPO3.Neos.NodeTypes:Text directly on page. I
> tried various approaches including:
> > NodeTypes.yaml
> > 'TYPO3.Neos.NodeTypes:Page':
> >   childNodes:
> >     headerLink1:
> >       type: 'TYPO3.Neos.NodeTypes:Text'
> >
> > Root.ts2
> > page.body {
> >       // Frontpage header links
> >       headerLink1 = TYPO3.Neos.NodeTypes:Text {
> >               node = ${q(site).children('headerLink1')}
> >       }
> > }
> >
> > But no success.
> > The editable area in BE is created and the Text node is present in page
> structure, but when it tries to save changes, an error occurs saying:
> > Node type "TYPO3.Neos.NodeTypes:Page" does not have a property "text"
> according to the schema.
> >
> > Another approach to somewhat achieve what I need would be to be able to
> limit ContentCollection to have only one child - no possibility to add more
> content nodes to the collection.
> >
> >
> ----------------------------------------------------
>
>
> _______________________________________________
> Neos mailing list
> Neos at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/neos
>


More information about the Neos mailing list