Skip to content

Commit

Permalink
Merge pull request #24 from sbruggmann/doc-completion
Browse files Browse the repository at this point in the history
Doc completion
  • Loading branch information
sbruggmann authored Jul 31, 2017
2 parents 93849a0 + 3de8608 commit 6294740
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 23 deletions.
4 changes: 2 additions & 2 deletions Documentation/Examples/ExtendTheCommentForm.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Let's assume we create a Blog-Package and have to add an optional phone field to the comment form.

**Add the new Property to the NodeType and Inspector Section**
**Add the new Property to the NodeType and Inspector Section<a name="add-property"></a>**

_Vendor.Blog/Configuration/NodeTypes.Comment.yaml_

Expand Down Expand Up @@ -90,7 +90,7 @@ _Vendor.Blog/Classes/Vendor/Blog/Traits/CommentPropertyTrait.php_

}

**Point to your custom Templates**
**Point to your custom Templates<a name="change-form-template"></a>**

_Vendor.Blog/Configuration/Views.yaml_

Expand Down
38 changes: 38 additions & 0 deletions Documentation/Examples/IntegrateInExistingNodeType.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Integrate in existing NodeType

Let's assume we create a simple Blog-Package and wanna integrate [webexcess/comments](https://github.com/webexcess/WebExcess.Comments) in every Blog Post Node.

**Add the Comments Mixins to your NodeType**

_Vendor.Blog/Configuration/NodeTypes.Post.yaml_

'Vendor.Blog:Post':
superTypes:
// ...
'WebExcess.Comments:CommentsContentCollection': true
'WebExcess.Comments:HideFormMixin': true
// ...

**Add the Comments Rendering to your Prototype**

_Vendor.Blog/Resources/Private/Fusion/Pages/Post.fusion_

prototype(Vendor.Blog:Post) {
body.content.main {

// ...

comments = WebExcess.Comments:Content {
@process.contentElementWrapping >
[email protected] >
}
}
}

**Make the ContentCollection available**

flow node:repair --node-type Vendor.Blog:Post

**Result**

Now every Blog-Post contains automatically a fully working Comments-Section.
29 changes: 8 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,33 +44,20 @@ composer require webexcess/comments
- Manipulating the comment listing,
- User presentation,
- etc.
- [Form Template](#example-form-template)
- Form Template
- Change the Form markup with a [Views.yaml](http://flowframework.readthedocs.io/en/stable/TheDefinitiveGuide/PartIII/ModelViewController.html#configuring-views-through-views-yaml) entry
- Email Template
- Change the Email format and template in the packages settings
- Signals and Slots
- The package sends the signal `commentCreated`. Read more about signal [here](http://flowframework.readthedocs.io/en/stable/TheDefinitiveGuide/PartIII/SignalsAndSlots.html).
- The package sends the signal `commentCreated`. Read more about signals [here](http://flowframework.readthedocs.io/en/stable/TheDefinitiveGuide/PartIII/SignalsAndSlots.html).

### Examples
### Extension and Integration Examples
- [Integrate in existing NodeType](Documentation/Examples/IntegrateInExistingNodeType.md)
- [Send a review Email on new Comments](Documentation/Examples/SendReviewEmail.md)
- [Extend the Comment Form](Documentation/Examples/ExtendTheCommentForm.md)
- [Add a Property to Comments](Documentation/Examples/ExtendTheCommentForm.md#add-property)
- [Change Form and FormField Templates](Documentation/Examples/ExtendTheCommentForm.md#change-form-template)

#### Form-Template<a name="example-form-template"></a>
1. Create a *Views.yaml* file in the *Configuration* folder of your package
2. Paste the following code in this file

```yaml
-
requestFilter: 'isPackage("WebExcess.Comments") && isController("Comments")'
options:
partialRootPaths: ['resource://Your.Package/Private/Partials/Comments']
```
3. Create only the partial files you want to change. The others are still used from package.
#### Send a review Email on new Comments
[See here](Documentation/Examples/SendReviewEmail.md)
#### Extend the Comment Form
[See here](Documentation/Examples/ExtendTheCommentForm.md)

------------------------------------------

Expand Down

0 comments on commit 6294740

Please sign in to comment.