breadlesscode/neos-commentable
composer require breadlesscode/neos-commentable
Neos CMS plugin for commenting nodes
v1.1.4
- Requires
- neos/flow: *
- neos/neos: ~4.0
- neos/form-builder: ~1.0
Neos comments
A package for Neos CMS for commenting nodes.
Installation
Most of the time you have to make small adjustments to a package (e.g., the configuration in Settings.yaml). Because of that, it is important to add the corresponding package to the composer from your theme package. Mostly this is the site package located under Packages/Sites/. To install it correctly go to your theme package (e.g.Packages/Sites/Foo.Bar) and run following command:
composer require breadlesscode/neos-commentable --no-update
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.
Usage
1. Extend your document
You have to add the mixin Breadlesscode.Commentable:Mixin.Commentable
to your commentable node. This mixin in simply
adds a child node where the comments are stored.
2. Render the comments
Now you can add a the Breadlesscode.Commentable:Collection.Comment
Fusion-Prototype to your node. This is a simple
Neos.Neos:ContentCollection
which lists the comments.
3. Add the form
This Package provides a simple form implementation Breadlesscode.Commentable:Form.Comment
. This form adds the comment
to the current document node comment collection. You can simply add a finisher by extend the Fusion-Prototype:
prototype(Breadlesscode.Commentable:Form.Comment) {
finishers {
sayThankYou = Neos.Form.Builder:FlashMessageFinisher.Definition {
options {
messageTitle = 'Thank you!'
messageBody = 'Thanks for your comment'
}
}
}
}
If you want to use your own Form implementation, you should add the correct finisher
Breadlesscode.Commentable:From.Finisher.AddComment
.
Configuration
Breadlesscode:
Commentable:
# should the comment be added to the top?
addToTop: true
# should comments be hidden by default
hidden: true
License
The MIT License (MIT). Please see License File for more information.