You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+29-1Lines changed: 29 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -187,6 +187,34 @@ Flowpack:
187
187
In case exceptions are thrown in the node creation of the template, because a node constraint was not met or the `type` field was not set, the creation of the childNode is aborted, but we continue with the node creation of the other left over parts of the template.
188
188
It behaves similar with properties: In case a property value doesn't match its declared type the exception is logged, but we will try to continue with the next property.
189
189
190
+
# Commands
191
+
192
+
## Validate simple node templates
193
+
194
+
It might be tedious to validate that all your templates are working especially in a larger project. To validate the ones that are not dependent on data from the node creation dialog (less complex templates) you can utilize this command:
195
+
196
+
```sh
197
+
flow nodetemplate:validate
198
+
```
199
+
200
+
In case everything is okay it will succeed with `X NodeType templates validated.`.
201
+
202
+
But in case you either have a syntax error in your template or the template does not match the node structure (illegal properties) you will be warned:
203
+
204
+
```
205
+
76 of 78 NodeType template validated. 2 could not be build standalone.
206
+
207
+
My.NodeType:Bing
208
+
Property "someLegacyProperty" in NodeType "My.NodeType:Bing" | PropertyIgnoredException(Because property is not declared in NodeType. Got value `"bg-gray-100"`., 1685869035209)
209
+
210
+
My.NodeType:Bar (depends on "data" context)
211
+
Configuration ""${data.aListOfThings}"" in "childNodes.pages.withItems" | RuntimeException(Type NULL is not iterable., 1685802354186)
212
+
```
213
+
214
+
The standalone validation should detect errors and prevents editors having to deal with these errors at runtime.
215
+
216
+
For more complex templates, which are dependent on the node creation data, it is recommended to write separate tests. Currently, errors in templates depending on the data context will only be treated as warning, as they are probably not an issue at runtime.
217
+
190
218
## Create template from node subtree
191
219
192
220
When creating a more complex node template (to create multiple pages and content elements) it can be helpful to take the current node subtree from your workspace as reference.
@@ -196,7 +224,7 @@ For this case you can use the command:
0 commit comments