[Neos] Not able to add a new ContentCollection to page
Visay Keo
visay.keo at typo3.org
Fri Jun 27 11:15:06 CEST 2014
###
# Configuration/NodeTypes.yaml
#
'TYPO3.Neos.NodeTypes:Page':
childNodes:
'teaser':
type: 'TYPO3.Neos:ContentCollection'
'contentColumn2':
type: 'TYPO3.Neos:ContentCollection'
'contentColumn3':
type: 'TYPO3.Neos:ContentCollection'
After that run: ./flow node:autocreatechildnodes
Cheers,
Visay
On 06/27/2014 03:41 PM, David Gurk wrote:
> Hi,
>
> I'm just started this week to build my first simple website with TYPO3 Neos. Actually I'm stucked at the task "add more 'content sections' to a layout".
>
> Here my simplified code:
>
> # --------------------------
> # page objects in TypoScript2
> # --------------------------
>
> page = Page {
> ...
>
> body {
> ...
>
> content {
> // The default content section
> main = PrimaryContent {
> nodePath = 'main'
> }
>
> // Own content sections
> contentColumn2 = ContentCollection {
> nodePath = 'contentColumn2'
>
> @cache {
> mode = 'cached'
> }
> }
> contentColumn3 = ContentCollection {
> nodePath = 'contentColumn3'
>
> @cache {
> mode = 'cached'
> }
> }
> teaser = ContentCollection {
> nodePath = 'teaser'
>
> @cache {
> mode = 'cached'
> }
> }
> }
> }
>
> ...
> }
>
> // Additional configuration for the homepage
> homepage < page {
> body {
> pageType = 'homepage'
> }
> }
>
> # --------------------------
>
> # --------------------------
> # Default Template
> # --------------------------
>
> <html>
> <head>
> ...
> </head>
> <body>
> <f:section name="body">
> <div class="page-wrapper">
> <header>
> ...
> </header>
> <div class="content-wrapper">
> <div>
> {content.main -> f:format.raw()}
> </div>
> <f:if condition="{pageType} == 'homepage'">
> <div>
> {content.teaser -> f:format.raw()}
> </div>
> </f:if>
> <div>
> <div>{content.contentColumn2 -> f:format.raw()}</div>
> <div>{content.contentColumn3 -> f:format.raw()}</div>
> </div>
> </div>
> </div>
> </f:section>
>
> # --------------------------
>
> The PrimaryContent "content.main" is rendered as expected. The ContentCollections like "teaser" not.
>
> I got the following error message in the "frontend":
> # --------------------------
>
> Failed to render element
> homepage<TYPO3.Neos:Page>/
> body<TYPO3.TypoScript:Template>/
> content/
> teaser/
> __meta/
> cache/
> maximumLifetime
> No operation which satisfies the runtime constraints found for "context". (2014062710040177c444)
>
> # --------------------------
>
> I looked at the "TYPO3.NeosDemoTypo3Org" package and I can't see the different, why my code isn't working.
>
> Has anybody a suggestion?
>
> I would appreciate all help. =)
>
> Thanks and best regards
>
> David
>
More information about the Neos
mailing list