https://github.com/mindscreen/neos-prototype-generator
Generate default fusion-prototypes to map to view-components
https://github.com/mindscreen/neos-prototype-generator
fusion neoscms
Last synced: 11 months ago
JSON representation
Generate default fusion-prototypes to map to view-components
- Host: GitHub
- URL: https://github.com/mindscreen/neos-prototype-generator
- Owner: mindscreen
- License: gpl-3.0
- Created: 2018-12-10T15:20:37.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-09-18T14:18:40.000Z (over 6 years ago)
- Last Synced: 2025-07-17T04:08:07.899Z (11 months ago)
- Topics: fusion, neoscms
- Language: PHP
- Size: 23.4 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Mindscreen.Neos.PrototypeGenerator
This package provides a default prototype generator for creating fusion component-based prototypes to enable front-end developers to create a new node-type based on a yaml-configuration and a view-component without worrying about basic property-mapping.
## Installation
`composer require mindscreen/neos-prototype-generator`
## Usage
* Extend your new node-type from `Mindscreen.Neos:ContentComponent` (or include the `'Mindscreen.Neos:PrototypeGeneratorMixin'`).
* Inline-editable properties are recognized with `type: string` and `ui.inlineEditable: true`. Block-editing can be enabled with `ui.inline.editorOptions.multiLine: true`.
* Images (`Neos\Media\Domain\Model\ImageInterface`) provide a `Uri` and `Asset`.
* Child-nodes will render with their specific node as `node` in the context; `Neos.Neos:ContentCollection` will render with the respective `nodePath`
* Set a specific target-component prototype in `options.componentName`.
* Specify the child-node mapping in `options.componentMapping.childNodes.`
## Configuration
Settings:
```yaml
Mindscreen:
Neos:
PrototypeGenerator:
componentPatterns:
- ':Component.Atom.'
- ':Component.Molecule.'
- ':Component.Organism.'
superType: 'Neos.Neos:ContentComponent'
```
Usage in node-types:
```yaml
'Vendor.Package:Example':
superTypes:
'Neos.Neos:Content': true
'Mindscreen.Neos:PrototypeGeneratorMixin': true
childNodes:
main:
type: 'Neos.Neos:ContentCollection'
properties:
singleLine:
type: string
ui:
inlineEditable: true
inline:
editorOptions:
placeholder: singleline
multiLine:
type: string
ui:
inlineEditable: true
inline:
editorOptions:
placeholder: multiline
multiLine: true
options:
componentName: 'Vendor.Package:Components.General.Example'
componentMapping:
childNodes:
main: content
```
## Notes
### Content-Collections
If a node-type is a `Neos.Neos:ContentCollection` (e.g. to generate a simple box-component), a ContentCollection will be rendered as `content`. This can be configured with the option `options.componentMapping.childNodes.this`.