[Neos] Not able to add a new ContentCollection to page

David Gurk dgurk at medienwerft.de
Fri Jun 27 11:09:37 CEST 2014


I add it like below, but the error is still the same. And I discovered another odd behavior. On some still empty subpages the ContentCollection "teaser" does work, but the the other (f.e. "contentColumn2")  don't.

page = Page {
  body {
    content {
      // The default content section
      main = PrimaryContent {
        nodePath = 'main'
      }

      // Own content sections
      teaser = ContentCollection {
        nodePath = 'teaser'

        @cache {
          mode = 'cached'
          context {
            1 = 'node'
          }
        }
      }
      contentColumn2 = ContentCollection {
        nodePath = 'contentColumn2'

        @cache {
          mode = 'cached'
          context {
            1 = 'node'
          }
        }
      }
      contentColumn3 = ContentCollection {
        nodePath = 'contentColumn3'

        @cache {
          mode = 'cached'
          context {
            1 = 'node'
          }
        }
      }
    }
  }
}

-----Ursprüngliche Nachricht-----
Von: neos-bounces at lists.typo3.org [mailto:neos-bounces at lists.typo3.org] Im Auftrag von Tomita MILITARU
Gesendet: Freitag, 27. Juni 2014 11:01
An: TYPO3 Neos mailing list
Betreff: Re: [Neos] Not able to add a new ContentCollection to page

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
_______________________________________________
Neos mailing list
Neos at lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/neos


More information about the Neos mailing list