[Neos] Not able to add a new ContentCollection to page
Tomiţă MILITARU
militarutomita at gmail.com
Fri Jun 27 11:00:37 CEST 2014
For each ContentCollection, try to add the cache context, for eg:
teaser = ContentCollection {
nodePath = 'teaser'
@cache {
mode = 'cached'
context {
1 = 'node'
}
}
}
On Fri, Jun 27, 2014 at 11:41 AM, David Gurk <dgurk at medienwerft.de> 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
>
> _______________________________________________
> Neos mailing list
> Neos at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/neos
>
--
--
*Tomiţă MILITARU*
Web Developer
Tel. +40741064681
More information about the Neos
mailing list