-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathCase.fusion
39 lines (36 loc) · 1.3 KB
/
Case.fusion
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
prototype(Carbon.IncludeAssets:Case) < prototype(Neos.Fusion:Component) {
@propTypes {
mixin = ${PropTypes.string}
document = ${PropTypes.string}
content = ${PropTypes.string}
appendFilter = ${PropTypes.string}
contentCollection = ${PropTypes.string}
documentNode = ${PropTypes.instanceOf('Neos.Neos:Document').isRequired}
alwaysInclude = ${PropTypes.boolean}
}
mixin = ${null}
document = ${this.mixin}
content = ${this.mixin}
appendFilter = ''
contentCollection = '[instanceof Neos.Neos:ContentCollection]'
documentNode = ${documentNode}
alwaysInclude = ${node.context.inBackend}
renderer = Neos.Fusion:Case {
alwaysInclude {
condition = ${props.alwaysInclude}
renderer = true
}
isDocument {
condition = ${props.document && q(props.documentNode).is('[instanceof ' + props.document + ']' + props.appendFilter)}
renderer = true
}
isContent {
condition = ${props.content && q(props.documentNode).children(props.contentCollection).find('[instanceof ' + props.content + ']' + props.appendFilter).is()}
renderer = true
}
default {
condition = true
renderer = false
}
}
}