Skip to content

Commit c1ad2e5

Browse files
author
Marvin Kuhn
committed
added usage section to readme
1 parent 15db45a commit c1ad2e5

File tree

1 file changed

+39
-1
lines changed

1 file changed

+39
-1
lines changed

README.md

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,45 @@ composer require breadlesscode/neos-commentable --no-update
1717
The --no-update command prevent the automatic update of the dependencies. After the package was added to your theme composer.json, go back to the root of the Neos installation and run composer update. Your desired package is now installed correctly.
1818

1919
## Usage
20-
Coming soon
20+
21+
### 1. Extend your document
22+
You have to add the mixin `Breadlesscode.Commentable:Mixin.Commentable` to your commentable node. This mixin in simply
23+
adds a child node where the comments are stored.
24+
25+
### 2. Render the comments
26+
Now you can add a the `Breadlesscode.Commentable:Collection.Comment` Fusion-Prototype to your node. This is a simple
27+
`Neos.Neos:ContentCollection` which lists the comments.
28+
29+
### 3. Add the form
30+
This Package provides a simple form implementation `Breadlesscode.Commentable:Form.Comment`. This form adds the comment
31+
to the current document node comment collection. You can simply add a finisher by extend the Fusion-Prototype:
32+
33+
```neosfusion
34+
prototype(Breadlesscode.Commentable:Form.Comment) {
35+
finishers {
36+
sayThankYou = Neos.Form.Builder:FlashMessageFinisher.Definition {
37+
options {
38+
messageTitle = 'Thank you!'
39+
messageBody = 'Thanks for your comment'
40+
}
41+
}
42+
}
43+
}
44+
```
45+
46+
If you want to use your own Form implementation, you should add the correct finisher
47+
`Breadlesscode.Commentable:From.Finisher.AddComment`.
48+
49+
## Configuration
50+
51+
```yaml
52+
Breadlesscode:
53+
Commentable:
54+
# should the comment be added to the top?
55+
addToTop: true
56+
# should comments be hidden by default
57+
hidden: true
58+
```
2159
2260
## License
2361
The MIT License (MIT). Please see [License File](LICENSE) for more information.

0 commit comments

Comments
 (0)