Good morning @BenjaminK,
now I’m using this case again, but unfortunately it doesn’t work, even with Your changes (I’ve changed ‘item’ to ‘node’). I’ve created a Team node type and an Employee node type. But I can’t access the employees within the team node type. The properties won’t be displayed. It would be nice if You (or someone else) can help me with this problem. Here is my setup…
NodeTypes.Team.yaml
'Foo.Website:Team':
superTypes:
'Neos.Neos:Content': TRUE
ui:
label: i18n
group: 'collectiveContent'
icon: 'icon-users'
position: 400
childNodes:
employees:
type: 'Neos.Neos:ContentCollection'
constraints:
nodeTypes:
'*': FALSE
'Foo.Website:Employee': TRUE
properties:
headlineTag: []
subheadlineTag: []
sortProperty:
type: string
defaultValue: 'date'
ui:
label: i18n
inlineEditable: FALSE
reloadIfChanged: TRUE
inspector:
group: 'options'
position: 2
editor: Content/Inspector/Editors/SelectBoxEditor
editorOptions:
placeholder: 'Foo.Website:NodeTypes.Team:properties.sortProperty.editor.placeholder'
values:
firstname:
label: 'Foo.Website:NodeTypes.Team:properties.sortProperty.editor.values.firstname'
position: 1
lastname:
label: 'Foo.Website:NodeTypes.Team:properties.sortProperty.editor.values.lastname'
position: 2
_index:
label: 'Foo.Website:NodeTypes.Team:properties.sortProperty.editor.values.sortingindex'
position: 3
sortOrder:
type: string
defaultValue: 'desc'
ui:
label: i18n
inlineEditable: FALSE
reloadIfChanged: TRUE
inspector:
group: 'options'
position: 3
editor: Content/Inspector/Editors/SelectBoxEditor
editorOptions:
placeholder: 'Foo.Website:NodeTypes.Team:properties.sortOrder.editor.placeholder'
values:
asc:
label: 'Foo.Website:NodeTypes.Team:properties.sortOrder.editor.values.asc'
position: 1
desc:
label: 'Foo.Website:NodeTypes.Team:properties.sortOrder.editor.values.desc'
position: 2
NodeTypes.Employee.yaml
'Foo.Website:Employee':
superTypes:
'Neos.Neos:Content': TRUE
ui:
label: i18n
group: 'collectiveContent'
icon: 'icon-user'
position: 500
properties:
fullWidth: []
headlineTag: []
subheadlineTag: []
spacingTop: []
spacingBottom: []
tags:
type: 'references'
ui:
label: i18n
inlineEditable: FALSE
reloadIfChanged: TRUE
inspector:
group: 'editing'
editorOptions:
nodeTypes: ['Foo.Website:Tag']
image:
type: Neos\Media\Domain\Model\ImageInterface
ui:
label: i18n
inlineEditable: FALSE
reloadIfChanged: TRUE
inspector:
group: 'image'
title:
type: string
defaultValue: ''
ui:
label: i18n
inlineEditable: FALSE
reloadIfChanged: TRUE
inspector:
group: 'text'
validation:
'Neos.Neos/Validation/NotEmptyValidator': []
firstname:
type: string
defaultValue: ''
ui:
label: i18n
inlineEditable: FALSE
reloadIfChanged: TRUE
inspector:
group: 'text'
validation:
'Neos.Neos/Validation/NotEmptyValidator': []
search:
fulltextExtractor: ${Indexing.extractInto('h1', value)}
lastname:
type: string
defaultValue: ''
ui:
label: i18n
inlineEditable: FALSE
reloadIfChanged: TRUE
inspector:
group: 'text'
validation:
'Neos.Neos/Validation/NotEmptyValidator': []
search:
fulltextExtractor: ${Indexing.extractInto('h1', value)}
position:
type: string
defaultValue: ''
ui:
label: i18n
inlineEditable: FALSE
reloadIfChanged: TRUE
inspector:
group: 'text'
validation:
'Neos.Neos/Validation/NotEmptyValidator': []
search:
fulltextExtractor: ${Indexing.extractInto('h2', value)}
email:
type: string
defaultValue: ''
ui:
label: i18n
inlineEditable: FALSE
reloadIfChanged: TRUE
inspector:
group: 'text'
search:
fulltextExtractor: ${Indexing.extractInto('h3', value)}
telephone:
type: string
defaultValue: ''
ui:
label: i18n
inlineEditable: FALSE
reloadIfChanged: TRUE
inspector:
group: 'text'
search:
fulltextExtractor: ${Indexing.extractInto('h4', value)}
alignment:
type: string
defaultValue: 'date'
ui:
label: i18n
inlineEditable: FALSE
reloadIfChanged: TRUE
inspector:
group: 'design'
editor: Content/Inspector/Editors/SelectBoxEditor
editorOptions:
placeholder: 'Foo.Website:NodeTypes.Employee:properties.alignment.editor.placeholder'
values:
left:
label: 'Foo.Website:NodeTypes.Employee:properties.alignment.editor.values.left'
position: 1
right:
label: 'Foo.Website:NodeTypes.Employee:properties.alignment.editor.values.right'
position: 2
random:
label: 'Foo.Website:NodeTypes.Employee:properties.alignment.editor.values.random'
position: 3
Team.fusion
prototype(Foo.Website:Team) < prototype(Neos.Neos:Content) {
templatePath = 'resource://Foo.Website/Private/Templates/NodeTypes/Team.html'
# Get Team container properties
sortProperty = ${q(node).property('sortProperty')}
sortOrder = ${q(node).property('sortOrder')}
# Get all employees
employees = Neos.Fusion:Collection {
collection = ${q(node).children().children()}
itemName = 'node'
itemRenderer = Neos.Fusion:Template {
templatePath = 'resource://Foo.Website/Private/Templates/NodeTypes/Partials/Employee.html'
node = ${node}
}
}
# Setup caching
@cache {
mode = 'cached'
entryIdentifier {
node = ${node}
}
entryTags {
1 = 'NodeType_Foo.Website:Employee'
2 = ${'Node_' + node.identifier}
}
}
}
Employee.fusion
prototype(Foo.Website:Employee) < prototype(Neos.Neos:Content) {
templatePath = 'resource://Foo.Website/Private/Templates/NodeTypes/Partials/Employee.html'
# Get Employee properties
tags = ${q(node).property('tags')}
image = ${q(node).property('image')}
title = ${q(node).property('title')}
firstname = ${q(node).property('firstname')}
lastname = ${q(node).property('lastname')}
position = ${q(node).property('position')}
email = ${q(node).property('email')}
telephone = ${q(node).property('telephone')}
alignment = ${q(node).property('alignment')}
}
Team.html
{namespace neos=Neos\Neos\ViewHelpers}
{namespace media=Neos\Media\ViewHelpers}
{namespace laudert=Foo\Website\ViewHelpers}
<f:if condition="{employees}">
<f:then>
<div class="container {class}" data-spacing="{spacingTop}-{spacingBottom}">
<div class="team">
<ul class="team-list" data-filter-content="withSquares">
{employees -> f:format.raw()}
</ul>
</div>
</div>
</f:then>
<f:else>
<f:if condition="{neos:rendering.inEditMode()}">
<div class="neos-backend-information">
{f:translate(id: 'frontend.label.team.noItems', package: 'Foo.Website', source: 'Main')}
</div>
</f:if>
</f:else>
</f:if>
Employee.html
{namespace neos=Neos\Neos\ViewHelpers}
{namespace media=Neos\Media\ViewHelpers}
{namespace laudert=Foo\Website\ViewHelpers}
<li class="team-item" data-filter-string="{node.properties.firstname} {node.properties.lastname}"
data-tags="{f:if(condition:i.isLast, then:'{tag.properties.value}', else:'{tag.properties.value},') -> f:for(each:node.properties.tags, as: 'tag', iteration: 'i')}">
<div class="employee employee-{laudert:employeeAlignment(sAlignment:node.properties.alignment)}">
<div class="employee-image">
<f:if condition="{node.properties.image}">
<f:if condition="{neos:rendering.inEditMode()}">
<f:then>
<img src="{f:uri.resource(resource: node.properties.image.resource)}"
alt="{node.properties.image.caption}"
title="{node.properties.image.title}">
</f:then>
<f:else>
<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"
data-src="{f:uri.resource(resource: node.properties.image.resource)}"
alt="{node.properties.image.caption}"
title="{node.properties.image.title}">
</f:else>
</f:if>
</f:if>
</div>
<div class="employee-name">
<span class="employee-name-first">{node.properties.firstname -> f:format.raw()}</span><br>
<span class="employee-name-last">{node.properties.lastname -> f:format.raw()}</span>
</div>
<div class="employee-info">
<div class="employee-info-content">
<strong class="employee-info-position">{node.properties.position -> f:format.raw()}</strong>
<span class="employee-info-mail">{node.properties.email -> f:format.raw()}</span>
<span class="employee-info-tel">{node.properties.telephone}</span>
</div>
</div>
</div>
</li>
Backend