Basic NodeTypes for Neos CMS.
composer require webexcess/basetypes
Neos Version | Package Version | Maintained |
---|---|---|
3.x | 1.x | YES |
2.3 LTS | 0.x | NO |
- Heading
- Paragraph
- Responsive Image (srcset)
- SVG-Image
- Button
- Responsive Iframe
- Grid (two-, three- and four-column)
- Home
- Page
Rules:
- Each first code-line of a file contains a comment with the respective css class, e.g.
# basetype-paragraph
- Properties are always namespaced with the BaseType Name, e.g.
paragraphText
- not onlytext
Structure:
- Each NodeType is composed out of Mixin parts. For the Paragraph these are:
WebExcess.BaseTypes:Content
defines the NodeType as a Content-ElementWebExcess.BaseTypes:Paragraph.ui
makes the NodeType an needed Inspector Groups visibleWebExcess.BaseTypes:Paragraph.properties.paragraphText--inplace
enables the Property paragraphText with inplace settings
- Each Property is available in three modes:
WebExcess.BaseTypes:Paragraph.properties.paragraphText
the basic property settingsWebExcess.BaseTypes:Paragraph.properties.paragraphText--inspector
.. including the inspector settingsWebExcess.BaseTypes:Paragraph.properties.paragraphText--inplace
.. including the inplace settings
Hint:
- Import your initial content with
./flow site:import --package-key WebExcess.BaseTypes
BaseTypes is replacing and extending existing Neos NodeTypes and enables you to easily build and extend your own custom NodeTypes.
Example:
Create in your Theme Package a Teaser-NodeType which includes an image, an inplace editable heading and text..
NodeTypes.Teaser.yaml
'WebExcess.Theme:Teaser':
superTypes:
'WebExcess.BaseTypes:Content': true
'WebExcess.BaseTypes:Heading.ui': true
'WebExcess.BaseTypes:Heading.properties.headingText--inplace': true
'WebExcess.BaseTypes:Heading.properties.headingTagName--inspector': true
'WebExcess.BaseTypes:Paragraph.ui': true
'WebExcess.BaseTypes:Paragraph.properties.paragraphText--inplace': true
'WebExcess.BaseTypes:Image.ui': true
'WebExcess.BaseTypes:Image.properties.imageAsset--inspector': true
'WebExcess.BaseTypes:Button.properties.buttonUrl--inspector': true
'WebExcess.BaseTypes:Button.properties.buttonStyle': true
ui:
label: 'Teaser'
icon: icon-file-text-o
NodeTypes.Teaser.fusion
prototype(WebExcess.Theme:Teaser) >
prototype(WebExcess.Theme:Teaser) < prototype(WebExcess.BaseTypes:Image) {
content = Neos.Fusion:Array {
heading = WebExcess.BaseTypes:HeadingObject
heading.@position = 'after image'
text = WebExcess.BaseTypes:ParagraphObject
text.@position = 'after heading'
}
}
That's all
- "Copy-paste is much better than DRY in a lot of cases... Bad abstraction is much worse than no abstraction." Dmitri Pisarev
- "Any problem in computer science can be solved with another layer of indirection. But that usually will create another problem." David Wheeler