Hi,
for all, those are looking for a working example.
Maybe it’s a bit of «quick and dirty» and may not be as contemplated by Neos. But:
- it works on Neos 2.2.+ like a charme
- it produces no confusing (for this simple situation – only an IMHO) and increasingly content-collection folder in Backend and also in sourceCode.
- it creates as little as possible sourceCode
####BUT: No guarantee!
I have used the code-principle from https://github.com/psmb/Sfi.Grid. No deeper understanding about Neos mechanism. Maybe this is only a work-around, which is perhaps no longer work in the future. I hope it will, because of clarity and ease…
I publish it because of @stefkey question. Carousel with text over it? (layer)
So, the working example: (*changed on 2016_05_23 patched inheritance fault in my code and change div-html-tag to section-html-tag)
#nodeTypes.SmarterSection.yaml
##
# Smart Section without content-collection folder in background
##
'VendorName.SiteName:SmarterSection':
superTypes:
'TYPO3.Neos:Content': TRUE
'TYPO3.Neos:ContentCollection': TRUE
ui:
label: Smart Sektion
icon: 'icon-align-justify'
group: 'ownGroup'
inlineEditable: TRUE
inspector:
groups:
ownGroup:
label: 'ownGroup'
properties:
withClearfix:
type: boolean
reloadIfChanged: true
ui:
label: mit Clearfix
help:
message: "Fügt .clearfix Klasse hinzu"
inspector:
group: ownGroup
constraints:
nodeTypes:
'*': TRUE
# SmarterSection.ts2
### SmarterSection with clearfix possibility
prototype(VedorName.SiteName:SmarterSection) < prototype(TYPO3.TypoScript:Tag) {
tagName = 'section'
content = TYPO3.Neos:ContentCollectionRenderer
attributes.class = ${(attributes.class ? attributes.class + ' ' : '') + 'smarter-section' + (q(node).property('class') ? ' ' + q(node).property('class') : '' ) + (q(node).property('withClearfix') ? ' clearfix' : '' )}
# We have to define contentElementWrapping, because we do not inherit from TYPO3.Neos:Content
@process.contentElementWrapping = TYPO3.Neos:ContentElementWrapping
}
Result:
This nodeType don’t use an own template – on porpous. It’s a working example.
Enjoy and happy coding