[SOLVED] Nesting Content Containers


(Bernhard Witz) #1

Hello

I have two NodeType templates similar to the following. The problem is that I can’t nest them. If I have one div container inside of the other the ContentTypes inside of the second are not displayed anymore. How can I use a container inside of other containers?

{namespace neos=Neos\Neos\ViewHelpers}
<div class="container inline">
    {sectionContent -> f:format.raw()}
</div>

(Bernhard Witz) #2

It seems that I found a working solution. If someone else is interested here what I wrote in the other files for my node type with the name “Container”.

NodeTypes.Container.yaml

'my.DemoSite:Container':
  superTypes:
    'Neos.Neos:Content': true
    'Neos.Neos:ContentCollection': true
  childNodes:
    sectioncontent:
      type: 'Neos.Neos:ContentCollection'
      constraints:
        nodeTypes:
          '*': true
  ui:
    label: 'Content Container'
    icon: icon-box-open
    group: demosite
    help:
      message: 'Container für weitere Inhaltselemente'
    inlineEditable: true
    inspector:
      groups:
        picardangstsettings:
          label: 'DemoSite Einstellungen'

Container.fusion

prototype(my.DemoSite:Container) {
    sectionContent = Neos.Neos:ContentCollection {
        nodePath = 'sectioncontent'
    }
}

(Leandro Rodrigo) #3

Hi Bernhard, I’m trying to do something similar, but for some reason, the content inside the ContentCollection isn’t rendered. First, I tried on my own and it didn’t work, now I just copy&paste what you’ve done (changing ‘my.DemoSite’ and ui: group: ‘demote’) but it’s still not rendering at all.

I posted yesterday and I’m waiting for any reply. I’ll appreciate if you can give me a hint, or maybe there’s an extra configuration that I’m stepping.

[EDIT] I’m using the Neos 4.0