I would like to nested the content-Collections in the Frontend-SourceCode and only output what is filled with content. There’s probably a much simpler solution for, I guess.
Explanation of my intention:
In Backend, the structure looks like this:

Now the sourceCode is:
<div class="neos-content-collection" role="banner">
//content from Content Collection (header)
</div>
<div class="neos-content-collection" role="main">
//content from Content Collection (main)
</div>
<div class="neos-content-collection" role="content-info">
//content from Content Collection (footer)
</div>
… no matter whether something is in the collections or not.
I would like to nested the header and footer into the main-content Tag and suppress header-tag||footer-tag if these are empty:
So, the sourceCode would be more compact and the structure more html5-like, but the Backend would remain clear and easy to fill.
# with main, header-content and footer-content.
<div class="neos-content-collection" role="main">
<div class="neos-content-collection" role="banner">
//content from Content Collection (header)
</div>
//content from Content Collection (main)
<div class="neos-content-collection" role="content-ifno">
//content from Content Collection (footer)
</div>
</div>
— or —
# with main, header-content but NO footer-content.
<div class="neos-content-collection" role="main">
<div class="neos-content-collection" role="banner">
//content from Content Collection (header)
</div>
//content from Content Collection (main)
</div>
— or —
# with main, NO header-content BUT footer-content.
<div class="neos-content-collection" role="main">
//content from Content Collection (main)
<div class="neos-content-collection" role="content-ifno">
//content from Content Collection (footer)
</div>
</div>
— or —
# with main, NO header-content NO footer-content.
<div class="neos-content-collection" role="main">
//content from Content Collection (main)
</div>
Hope this will explain what I’m trying to. It also works the way it is, but I’m interested in whether I could optimize the SourceCode in the desired direction.
[quote=“christianm, post:2, topic:1159”]
instead of directly putting them in the template or definining them separately in TypoScript for body
[/quote] Sorry, but I can’t see the solution for my intention. Maybe you know an online example of:
- putting them in the template and break-open the parts of the contentCollection (attributes/content-value/…)?
- defining them sepeately in TypoScript for body?
Maybe you or someone else knows a link to various templates or structural ideas to expand my horizon or find a solution.
Thank you very much for your help so far