Skip to content

Commit 0d6ae5b

Browse files
committed
TASK: Improve documentation of nodeTemplate CLI commands
1 parent f37b6c4 commit 0d6ae5b

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

Classes/Application/Command/NodeTemplateCommandController.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,9 @@ class NodeTemplateCommandController extends CommandController
5757
* Dump the node tree structure into a NodeTemplate YAML structure.
5858
* References to Nodes and non-primitive property values are commented out in the YAML.
5959
*
60-
* @param string $startingNodeId specified root node of the node tree
61-
* @param string $workspaceName
60+
* @param string $startingNodeId specified root node of the node tree.
61+
* @param string|null $site the Neos site, which determines the content repository. Defaults to the first available one.
62+
* @param string $workspaceName custom workspace to dump from. Defaults to 'live'.
6263
* @return void
6364
*/
6465
public function createFromNodeSubtreeCommand(string $startingNodeId, ?string $site = null, string $workspaceName = 'live'): void
@@ -95,6 +96,7 @@ public function createFromNodeSubtreeCommand(string $startingNodeId, ?string $si
9596
*
9697
* We process and build all configured NodeType templates. No nodes will be created in the Content Repository.
9798
*
99+
* @param string|null $site the Neos site, which determines the content repository. Defaults to the first available one.
98100
*/
99101
public function validateCommand(?string $site = null): void
100102
{

README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,15 +239,18 @@ It behaves similar with properties: In case a property value doesn't match its d
239239
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:
240240

241241
```sh
242-
flow nodetemplate:validate
242+
flow nodetemplate:validate [<options>]
243243
```
244244

245+
**options:**
246+
- `--site`: the Neos site, which determines the content repository. Defaults to the first available one.
247+
245248
In case everything is okay it will succeed with `X NodeType templates validated.`.
246249

247250
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:
248251

249252
```
250-
76 of 78 NodeType template validated. 2 could not be build standalone.
253+
Content repository "default": 76 of 78 NodeType template validated. 2 could not be build standalone.
251254
252255
My.NodeType:Bing
253256
Property "someLegacyProperty" in NodeType "My.NodeType:Bing" | PropertyIgnoredException(Because property is not declared in NodeType. Got value `"bg-gray-100"`., 1685869035209)
@@ -266,9 +269,15 @@ When creating a more complex node template (to create multiple pages and content
266269
For this case you can use the command:
267270

268271
```sh
269-
flow nodeTemplate:createFromNodeSubtree <nodeIdentifier>
272+
flow nodeTemplate:createFromNodeSubtree <starting node id> [<options>]
270273
```
271274

275+
- `--starting-node-id`: specified root node of the node tree
276+
277+
**options:**
278+
- `--site`: the Neos site, which determines the content repository. Defaults to the first available one.
279+
- `--workspace-name`: custom workspace to dump from. Defaults to 'live'.
280+
272281
It will give you the output similar to the yaml example above.
273282
References to Nodes and non-primitive property values are commented out in the YAML.
274283

0 commit comments

Comments
 (0)