Skip to content

Instantly share code, notes, and snippets.

@jonnitto
Last active January 14, 2020 08:19
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jonnitto/0b1a93f88329c03b127f63532c60ef2d to your computer and use it in GitHub Desktop.
Save jonnitto/0b1a93f88329c03b127f63532c60ef2d to your computer and use it in GitHub Desktop.
Neos.io: Add a little hint if the shown content is from a different content dimension
prototype(Neos.Neos:Content) {
@process.contentDimensions {
expression = Foo.Bar:ShowContentDimensions
@position = 'end'
}
}
prototype(Neos.Neos:ContentComponent) {
@process.contentDimensions {
expression = Foo.Bar:ShowContentDimensions
@position = 'end'
}
}
.neos.content-dimensions-backend {
font-size: 10px;
background: rgba(0, 0, 0, 0.5);
display: inline-block;
padding: 5px 5px 8px;
}
.neos.content-dimensions-backend span {
display: inline-block;
padding: 0 10px;
}
.neos.content-dimensions-backend i {
padding-right: 5px;
}
prototype(Foo.Bar:ShowContentDimensions) < prototype(Neos.Fusion:Component) {
value = ${value}
dimension = 'language'
icon = ${this.dimension}
@if {
inBackend = ${node.context.inBackend}
// node.context.targetDimensions[this.dimension] == target dimension
// node.dimensions[this.dimension][0] == current dimension
needBox = ${node.context.targetDimensions[this.dimension] != node.dimensions[this.dimension][0]}
}
renderer = Neos.Fusion:Array {
box = Neos.Fusion:Tag {
dimensions = ${Configuration.setting('Neos.ContentRepository.contentDimensions')}
value = ${this.dimensions[props.dimension]presets[node.dimensions.[props.dimension][0]].label}
attributes.class = 'content-dimensions-backend neos'
content = ${' <span><i class="icon-' + props.icon +'"></i>' + this.value + '</span> '}
}
value = ${props.value}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment