Skip to content

Commit

Permalink
TASK: Explain how to setup page rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebobo committed Mar 1, 2019
1 parent 1588ed9 commit e73cfdb
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 2 deletions.
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,32 @@ Afterwards you can configure a few things in the inspector.
* `Author` The author which will be included in the xml.
* `Description for the feed` A short description which will be included in the xml.

### Setup page rendering

By default the `Feed`, `Category` and `Article` document types will inherit their rendering from `Neos.Neos:Page`.
So if you extended this prototype in your own site package, the rendering should work fine as this
package will override the `Neos.Neos:PrimaryContent` prototype which most projects use to render the main content area.
This way the blog will render it's own content where you usually have your main content.

If not you might get an error like `No template path set. ...`.
Then you have to tell the package which document prototype it should use as basis.

For the `Neos.Demo` site package it would look like this:

prototype(Shel.Blog:Document.GenericBlogPage) < prototype(Neos.NodeTypes:Page)

This way, the feed, category and article document types will know how to render.
Of course you can also give their prototypes each a different parent prototype instead of the `GenericBlogPage`.

That would look like this:

prototype(Shel.Blog:Document.Feed) < prototype(My.Package:MyFeedPage)
prototype(Shel.Blog:Document.Article) < prototype(My.Package:MyArticlePage)

Changing the parent prototype of `Feed` will also change the one for `Category` as it inherits from `Feed`.

Remember that you need to render the `Neos.Neos:PrimaryContent` object somewhere to get output.

### Configure allowed content types

By default the blog article allows most elements defined in `Neos.NodeTypes`.
Expand Down
2 changes: 1 addition & 1 deletion Resources/Private/Fusion/Documents/Article.fusion
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
prototype(Shel.Blog:Document.Article) < prototype(Neos.Neos:Page) {
prototype(Shel.Blog:Document.Article) < prototype(Shel.Blog:Document.GenericBlogPage) {
prototype(Neos.Neos:PrimaryContent).shelBlogArticle {
condition = ${q(node).is('[instanceof Shel.Blog:Document.Article]')}
type = 'Shel.Blog:Component.Article'
Expand Down
2 changes: 1 addition & 1 deletion Resources/Private/Fusion/Documents/Feed.fusion
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
prototype(Shel.Blog:Document.Feed) < prototype(Neos.Neos:Page) {
prototype(Shel.Blog:Document.Feed) < prototype(Shel.Blog:Document.GenericBlogPage) {
prototype(Neos.Neos:PrimaryContent).shelBlogFeed {
condition = ${q(node).is('[instanceof Shel.Blog:Document.Feed]')}
type = 'Shel.Blog:Component.Feed'
Expand Down
1 change: 1 addition & 0 deletions Resources/Private/Fusion/Documents/GenericBlogPage.fusion
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
prototype(Shel.Blog:Document.GenericBlogPage) < prototype(Neos.Neos:Page)

0 comments on commit e73cfdb

Please sign in to comment.