Skip to content

Commit ce751b4

Browse files
Initial version
1 parent a584200 commit ce751b4

15 files changed

+213
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
'CodeQ.Blog.Utils:Constraint.Document.NoSubDocuments':
2+
abstract: true
3+
constraints:
4+
nodeTypes:
5+
'Neos.Neos:Document': ~
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
##
2+
# Adding this as superType will prevent inserting this page type below normal pages
3+
#
4+
# [Youtube Tutorial explaining constraints](https://www.youtube.com/watch?v=ZCRYsYvxXFI&t=247s)
5+
#
6+
# Example:
7+
# Let's say you have a have a news overview of news pages below. To force
8+
# news pages to be created only directly below:
9+
#
10+
# 'CodeQ.Blog.Utils:Document.NewsOverview':
11+
# superTypes:
12+
# 'CodeQ.Site:Document.AbstractPage': true
13+
# constraints:
14+
# nodeTypes:
15+
# 'CodeQ.Site:Document.Restricted': false
16+
#
17+
# 'CodeQ.Blog.Utils:Content.News':
18+
# superTypes:
19+
# 'CodeQ.Site:Document.AbstractPage': true
20+
# 'CodeQ.Site:Constraint.Document.Restricted': true
21+
#
22+
##
23+
'CodeQ.Blog.Utils:Constraint.Document.Restricted':
24+
abstract: true
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
'CodeQ.Blog.Utils:Mixin.HideTitleOverride':
2+
abstract: true
3+
properties:
4+
titleOverride:
5+
ui:
6+
inspector:
7+
group: ~
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
'CodeQ.Blog.Utils:Mixin.Post.CreatedAt':
2+
abstract: true
3+
properties:
4+
createdAt:
5+
type: DateTime
6+
defaultValue: now
7+
ui:
8+
label: 'Veröffentlichungsdatum'
9+
reloadIfChanged: true
10+
inspector:
11+
group: document
12+
position: 'after uriPathSegment'
13+
editorOptions:
14+
format: 'd.m.Y'
15+
validation:
16+
Neos.Neos/Validation/NotEmptyValidator: { }
17+
Neos.Neos/Validation/DateTimeValidator: { }
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
'CodeQ.Blog.Utils:Mixin.Post.CreatedBy':
2+
abstract: true
3+
properties:
4+
createdBy:
5+
type: string
6+
ui:
7+
label: Autor
8+
reloadIfChanged: true
9+
inspector:
10+
group: document
11+
position: after createdAt
12+
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
'CodeQ.Blog.Utils:Mixin.Post.Image':
2+
abstract: true
3+
superTypes:
4+
'CodeQ.Site:Mixin.ImageObjectPosition': true
5+
ui:
6+
inspector:
7+
groups:
8+
previewImage:
9+
label: Anzeige des Vorschau-Bildes
10+
icon: image
11+
position: 200
12+
properties:
13+
image:
14+
type: Neos\Media\Domain\Model\ImageInterface
15+
ui:
16+
label: 'Blogpost Bild'
17+
reloadIfChanged: true
18+
inspector:
19+
group: document
20+
position: 800
21+
imageObjectFit:
22+
ui:
23+
inspector:
24+
group: previewImage
25+
position: 100
26+
options:
27+
preset: 'layout.imageObjectFit'
28+
imageHorizontalPosition:
29+
ui:
30+
label: 'Horizontaler Teaser-Bildausschnitt'
31+
help:
32+
message: 'Bei 0% ist der ganz linke Teil des Bildes immer zu sehen, bei 100% der ganz rechte.'
33+
inspector:
34+
group: previewImage
35+
position: 200
36+
imageVerticalPosition:
37+
ui:
38+
label: 'Vertikaler Teaser-Bildausschnitt'
39+
help:
40+
message: 'Bei 0% ist der ganz oben Teil des Bildes immer zu sehen, bei 100% der ganz unten.'
41+
inspector:
42+
group: previewImage
43+
position: 300
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
'CodeQ.Blog.Utils:Mixin.Post':
2+
abstract: true
3+
superTypes:
4+
'CodeQ.Blog.Utils:Constraint.Document.Restricted': true
5+
'CodeQ.Blog.Utils:Constraint.Document.NoSubDocuments': true
6+
# Feature flags
7+
'CodeQ.Blog.Utils:Mixin.HideTitleOverride': true
8+
'CodeQ.Blog.Utils:Mixin.Post.CreatedAt': true
9+
'CodeQ.Blog.Utils:Mixin.Post.Image': true
10+
ui:
11+
label: 'Blogpost'
12+
icon: newspaper
13+
group: general
14+
position: 100
15+
childNodes:
16+
main:
17+
type: 'Neos.Neos:ContentCollection'
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
'Neos.Neos:Document':
2+
constraints:
3+
nodeTypes:
4+
'CodeQ.Blog.Utils:Constraint.Document.Restricted': false
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
'Neos.Neos:Shortcut':
2+
constraints:
3+
nodeTypes:
4+
'CodeQ.Blog.Utils:Constraint.Document.Restricted': false

Configuration/Settings.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Neos:
2+
Neos:
3+
fusion:
4+
autoInclude:
5+
CodeQ.Blog.Utils: true
6+
7+
CodeQ:
8+
Blog:
9+
Utils:
10+
includeDefaultAssets: false

0 commit comments

Comments
 (0)