neos / neos-development-collection

The unified repository containing the Neos core packages, used for Neos development.
https://www.neos.io/
GNU General Public License v3.0
260 stars 218 forks source link

BUG: ContentReference doesn't show hidden status of referenced node in backend #5147

Open Sebobo opened 2 weeks ago

Sebobo commented 2 weeks ago

Is there an existing issue for this?

Current Behavior

When the original node is hidden, the reference doesn't show the translucent effect like the original does, therefore making it impossible to see whether the original is hidden. The frontend completely hides the node.

Expected Behavior

The same translucent effect should be applied to references of hidden nodes

Steps To Reproduce

Create an image and hide it. Then use it in a reference.

Environment

- Neos: all versions probably

Anything else?

No response

Sebobo commented 2 weeks ago

How I solved it in my customers project for now:


    referenceNodes = Neos.Fusion:Collection {
        collection = ${referenceNodesArray}
        itemRenderer = Neos.Neos:ContentCase {
          # Show hidden state of referenced node in backend via CSS
          @process.applyHiddenProperty = Neos.Fusion:Augmenter {
            class = 'referenced-node-is-hidden'
            style = 'opacity: 0.3;'
            @if.hidden = ${node.hidden}
            @if.inBackend = ${node.context.inBackend}
          }
        }
        itemName = 'node'

      // Disable ContentElementWrapping for references itself
      prototype(Neos.Neos:ContentElementWrapping) {
        @if.render = false
      }
      // Disable InlineEditable for references itself
      prototype(Neos.Neos:Editable) {
        renderer.editable.condition = false
      }
    }

Note: I would have like to use the class from the Neos UI, but it is prefixed by the JS build.