1
1
#
2
- # Add the paginator's "current page" value to cache entry identifiers in cache layers above the blog posts index.
3
- # Depending on your actual page structure you will have to add this identifier part to further TypoScript object
4
- # cache configurations.
2
+ # Add the paginator's "current page" value to cache entry identifiers.
5
3
#
6
- [email protected] = ${request.pluginArguments.posts-paginator.currentPage}
7
-
8
- prototype(Neos.Neos:Page) {
9
- @cache.entryIdentifier.blogPostsPaginatorCurrentPage = ${request.pluginArguments.posts-paginator.currentPage}
10
- }
11
-
12
- prototype(Neos.Neos:PrimaryContent).default {
13
- [email protected] = ${request.pluginArguments.posts-paginator.currentPage}
14
- }
15
-
16
- #
17
- # Add a new matcher to the rendering of the main content (PrimaryContent) to check if the current node
18
- # is a blog post document. In this case we don't render a ContentCollection like the default matcher
19
- # but render the blog post TypoScript object.
20
- #
21
- prototype(Neos.Neos:PrimaryContent).blogPost {
22
- condition = ${q(documentNode).is('[instanceof RobertLemke.Plugin.Blog:Post]')}
23
- type = 'RobertLemke.Plugin.Blog:Post'
24
- }
4
+ prototype(Neos.Fusion:GlobalCacheIdentifiers).blogPostsPaginatorCurrentPage = ${request.pluginArguments.posts-paginator.currentPage}
25
5
26
6
#
27
7
# Blog Post is rendered by a Template-based TypoScript object which contains some
@@ -36,80 +16,81 @@ prototype(Neos.Neos:PrimaryContent).blogPost {
36
16
# The blog post comments are just several Text nodes which are as well rendered
37
17
# through the TypoScript collection feature.
38
18
#
39
- prototype(RobertLemke.Plugin.Blog:Post) < prototype(Neos.Neos:Content) {
40
- node = ${node}
19
+ prototype(RobertLemke.Plugin.Blog:Post) < prototype(Neos.NodeTypes:Page) {
20
+ body.content.main = RobertLemke.Plugin.Blog:PostRenderer
21
+ }
41
22
42
- # Render the main ContentCollection of the Post like a page would
43
- main = Neos.Neos:ContentCollection {
44
- nodePath = 'main'
45
- }
23
+ prototype(RobertLemke.Plugin.Blog:PostRenderer) < prototype(Neos.Fusion:Template) {
24
+ templatePath = 'resource://RobertLemke.Plugin.Blog/Private/Templates/NodeTypes/Post.html'
25
+ node = ${node}
26
+ title = ${q(node).property('title')}
27
+ author = ${q(node).property('author')}
28
+ datePublished = ${q(node).property('datePublished')}
46
29
47
- # Render an additional ContentCollection for comments
48
- comments = Neos.Neos:ContentCollection {
49
- nodePath = 'comments '
50
- }
30
+ # Render the main ContentCollection of the Post like a page would
31
+ main = Neos.Neos:ContentCollection {
32
+ nodePath = 'main '
33
+ }
51
34
52
- numberOfComments = ${q(node).children('comments').children('[spam = false]').count()}
35
+ # Render an additional ContentCollection for comments
36
+ comments = Neos.Neos:ContentCollection {
37
+ nodePath = 'comments'
38
+ }
53
39
54
- @cache {
55
- mode = 'cached'
56
- entryIdentifier {
57
- node = ${node}
58
- content = 'blogpost'
59
- }
60
- entryTags {
61
- 1 = ${'Node_' + node.identifier}
62
- 2 = ${'DescendantOf_' + q(node).find('main').property('_identifier')}
63
- 3 = ${'DescendantOf_' + q(node).find('comments').property('_identifier')}
64
- }
65
- }
66
- }
40
+ numberOfComments = ${q(node).children('comments').children('[spam = false]').count()}
67
41
68
- #
69
- # Blog Comment is rendered by a vanilla Template-based TypoScript object
70
- #
71
- prototype(RobertLemke.Plugin.Blog:Comment) {
42
+ @cache {
43
+ mode = 'cached'
44
+ entryIdentifier {
45
+ node = ${node}
46
+ content = 'blogpost'
47
+ }
48
+ entryTags {
49
+ 1 = ${'Node_' + node.identifier}
50
+ 2 = ${'DescendantOf_' + q(node).find('main').property('_identifier')}
51
+ 3 = ${'DescendantOf_' + q(node).find('comments').property('_identifier')}
52
+ }
53
+ }
72
54
}
73
55
74
56
#
75
57
# List of most recent blog posts, including pagination
76
58
#
77
59
prototype(RobertLemke.Plugin.Blog:PostsOverview) < prototype(Neos.Neos:Content) {
78
- hasPostNodes = true
79
- postsNode = ${q(node).closest('[instanceof Neos.Neos:Document]').get(0)}
80
- currentPage = ${request.pluginArguments.posts-paginator.currentPage}
60
+ postsNode = ${q(node).closest('[instanceof Neos.Neos:Document]').get(0)}
61
+ currentPage = ${request.pluginArguments.posts-paginator.currentPage}
81
62
82
- @cache {
83
- mode = 'cached'
84
- entryIdentifier {
85
- documentNode = ${node}
86
- currentPage = ${request.pluginArguments.posts-paginator.currentPage}
87
- }
88
- entryTags {
89
- 1 = ${'Node_' + node.identifier}
90
- 2 = ${'DescendantOf_' + q(node).property('_identifier')}
91
- }
92
- }
63
+ @cache {
64
+ mode = 'cached'
65
+ entryIdentifier {
66
+ documentNode = ${node}
67
+ currentPage = ${request.pluginArguments.posts-paginator.currentPage}
68
+ }
69
+ entryTags {
70
+ 1 = ${'Node_' + node.identifier}
71
+ 2 = ${'DescendantOf_' + q(node).property('_identifier')}
72
+ }
73
+ }
93
74
}
94
75
95
76
#
96
77
# RSS feed
97
78
#
98
79
prototype(RobertLemke.Plugin.Blog:Feed) < prototype(Neos.Neos:Plugin) {
99
- package = 'RobertLemke.Plugin.Blog'
100
- controller = 'Post'
101
- action = 'rss'
80
+ package = 'RobertLemke.Plugin.Blog'
81
+ controller = 'Post'
82
+ action = 'rss'
102
83
103
- postsNode = ${q(documentNode).parent().get(0)}
84
+ postsNode = ${q(documentNode).parent().get(0)}
104
85
105
- feedTitle = ${Configuration.setting('RobertLemke.Plugin.Blog.feed.title')}
106
- feedDescription = ${Configuration.setting('RobertLemke.Plugin.Blog.feed.description')}
107
- feedUri = ${Configuration.setting('RobertLemke.Plugin.Blog.feed.uri')}
108
- includeContent = ${Configuration.setting('RobertLemke.Plugin.Blog.feed.includeContent')}
86
+ feedTitle = ${Configuration.setting('RobertLemke.Plugin.Blog.feed.title')}
87
+ feedDescription = ${Configuration.setting('RobertLemke.Plugin.Blog.feed.description')}
88
+ feedUri = ${Configuration.setting('RobertLemke.Plugin.Blog.feed.uri')}
89
+ includeContent = ${Configuration.setting('RobertLemke.Plugin.Blog.feed.includeContent')}
109
90
}
110
91
111
92
#
112
93
# Quote is a straight-forward content type
113
94
#
114
- prototype(RobertLemke.Plugin.Blog:Quote) < prototype(Neos.Neos:Content) {
115
- }
95
+ prototype(RobertLemke.Plugin.Blog:Quote) < prototype(Neos.Neos:Content)
96
+
0 commit comments