Hi everyone, I’m super Noob in Neos and I’m dealing with some problems while I try to nest nodes. My goal is to achieve a section with some elements inside and a title. By now I could deal with everything following the documentation and posts, but now I can’t see anything when my nodes are inside this ContentCollection, but when I move out, everything works fine.
Here are the files
NodeTypes.Section.yaml
'My.Package:CardsSection':
superTypes:
'Neos.Neos:Content': TRUE
childNodes:
sectioncontent:
type: 'Neos.Neos:ContentCollection'
constraints:
nodeTypes:
'*': FALSE
'My.Package:Cards': TRUE
ui:
label: 'Items container section'
group: general
icon: 'icon-cubes'
inspector:
groups:
main:
label: 'Properties'
icon: 'icon-cubes'
position: 1
properties:
headline:
type: string
defaultValue: ''
ui:
label: 'Headline'
inlineEditable: FALSE
reloadIfChanged: TRUE
inspector:
group: 'main'
color:
type: string
validation:
'Neos.Neos/Validation/RegularExpressionValidator':
regularExpression: '/(^#([a-fA-F0-9]{3}){1,2}$)|(^rgba?\(\d{1,3}%?,\d{1,3}%?,\d{1,3}%?(,\d{1,3}%?)?\)$)/i'
ui:
label: 'Flat background color'
inlineEditable: FALSE
reloadIfChanged: TRUE
inspector:
group: 'main'
Section.fusion
prototype(My.Package:CardsSection) {
templatePath = 'resource://My.Package/Private/Templates/NodeTypes/CardsSection.html'
headline = ${q(node).property('headline')}
color = ${q(node).property('color')}
sectioncontent = Neos.Neos:ContentCollection {
nodePath = 'sectioncontent'
}
}
Section.html
{namespace neos=Neos\Neos\ViewHelpers}
{namespace fusion=Neos\Fusion\ViewHelpers}
<section class="employee-survey-real-time-section" style="background: {color}">
<div class="main-container">
{neos:contentElement.editable(property: 'headline', tag: 'h2')}
{sectioncontent -> f:format.raw()}
</div>
</section>
NodeTypes.Card.yaml
'My.Package:Cards':
superTypes:
'Neos.Neos:Content': TRUE
ui:
label: 'Card'
group: 'general'
icon: 'icon-cube'
inspector:
groups:
main:
label: 'Properties'
icon: 'icon-cube'
position: 1
properties:
image:
type: Neos\Media\Domain\Model\ImageInterface
ui:
label: 'Image'
inlineEditable: FALSE
reloadIfChanged: TRUE
inspector:
group: 'main'
headline:
type: string
defaultValue: ''
ui:
label: 'Headline'
inlineEditable: FALSE
reloadIfChanged: TRUE
inspector:
group: 'main'
paragraph:
type: string
defaultValue: ''
ui:
label: 'Paragraph'
inlineEditable: FALSE
reloadIfChanged: TRUE
inspector:
group: 'main'
Card.fusion
prototype(My.Package:Cards) < prototype(Neos.Neos:Content) {
templatePath = 'resource://My.Package/Private/Templates/Cards.html'
headline = ${q(node).property('headline')}
paragraph = ${q(node).property('paragraph')}
image = ${q(node).property('image')}
}
Card.html
{namespace neos=Neos\Neos\ViewHelpers}
{namespace media=Neos\Media\ViewHelpers}
<!-- Card -->
<div class="card-icon-text card-anim">
<div class="card-icon">
<f:if condition="{image}">
<media:image image="{image}" alt="{headline}" />
</f:if>
</div>
<div class="card-title">
{neos:contentElement.editable(property: 'headline', tag: 'h4')}
</div>
<div class="card-text">
{neos:contentElement.editable(property: 'paragraph', tag: 'p')}
</div>
</div>