Skip to content

Commit ea775dc

Browse files
authored
Merge pull request #76 from lorenzulrich/patch-1
TASK: Add information about showInCreationDialog and custom EEL helpers to readme
2 parents 4ffe6f3 + ff1b089 commit ea775dc

File tree

1 file changed

+39
-3
lines changed

1 file changed

+39
-3
lines changed

README.md

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ automatically creating helpful child nodes and making useful modifications to no
66
properties when creating new nodes in the Neos UI.
77

88
In contrast to child nodes that are defined in the regular node type definition
9-
(they cannot be removed by the editor), all modifications that are made when a
9+
(which cannot be removed by the editor), all modifications that are made when a
1010
template is applied can be changed or removed by the editor.
1111

1212
The desired node structure is defined in a declarative way in the NodeTypes.yaml
13-
under the path "options.template".
13+
under the path `options.template`.
1414

1515
## TL;DR
1616

@@ -39,7 +39,7 @@ to the main content collection of all pages that are created via the UI:
3939
4040
## Using the node creation dialog
4141
42-
The Neos React UI comes with a configurable node creation dialog. You can access
42+
The Neos UI comes with a configurable node creation dialog. You can access
4343
the data entered in the node creation dialog in your node templates using EEL queries.
4444
You could let the editor choose between different dummy texts like this:
4545
@@ -71,6 +71,32 @@ You could let the editor choose between different dummy texts like this:
7171
text: '${"<p>" + data.dummyText + "</p>"}'
7272
```
7373
74+
You can also access data from the node creation dialog if you use the
75+
`showInCreationDialog` feature:
76+
77+
```yaml
78+
'Some.Package:SomeNodeType':
79+
# ...
80+
properties:
81+
'firstName':
82+
type: string
83+
label: 'First Name'
84+
ui:
85+
showInCreationDialog: true
86+
'lastName':
87+
type: string
88+
label: 'First Name'
89+
ui:
90+
showInCreationDialog: true
91+
'cardTitle':
92+
type: string:
93+
label: 'Card Title'
94+
options:
95+
template:
96+
properties:
97+
cardTitle: '${"<h2>" + data.firstName + " " + data.lastName + "</h2>"}'
98+
```
99+
74100
## Conditions and loops
75101

76102
### Conditions
@@ -169,6 +195,16 @@ values are not available. As ``withContext`` is evaluated before ``when`` and ``
169195
access context variables from ``withContext`` in ``withItems`` at the same level – but not the other
170196
way around.
171197

198+
If you want to use a custom EEL helper, make sure to register it in the package's Settings. EEL
199+
helpers configured for Neos.Fusion are not automatically available:
200+
201+
```yaml
202+
Flowpack:
203+
NodeTemplates:
204+
defaultEelContext:
205+
My.Foo: 'My\Site\Eel\Helper\FooHelper'
206+
```
207+
172208
## Fine-grained error handling, resuming with the next possible operation.
173209

174210
In the first step the configuration is processed, exceptions like those caused by an EEL Expression are caught, and any malformed parts of the template are ignored (with their errors being logged).

0 commit comments

Comments
 (0)