daily pastebin goal
50%
SHARE
TWEET

Untitled

a guest Jan 22nd, 2018 271 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #
  2. # ATTENTION UNTESTED PSEUDO-CODE TO SHOW THE PRINCIPLE IDEA
  3. #
  4.  
  5. prototype(Neos.Fusion:RawCollection) {  
  6.   // store __node reference in the rendered result
  7.   // if item is a node and the value is an array
  8.   itemRenderer.@process.addNodeReference {
  9.     @if.itemIsNode = ${q(item).is('[instanceof Neos.Neos:Node]')}
  10.     @if.valueIsArray = ${Type.isArray(value)}
  11.     expression = ${Array.concat(value, [__node: item])}
  12.   }
  13. }
  14.  
  15.  
  16. prototype(Neos.Fusion:Collection) {
  17.   // apply content element wrapping to all items with __node meta property
  18.   itemRenderer.@process.applyContentElementWrapping {
  19.      @if.itemIsArray = ${Type.isArray(this[itemName])}
  20.      @if.itemHasNode = ${item.__node && q(this[itemName].__node).is('[instanceof Neos.Neos:Node]')}
  21.      expression = Neos.Neos:ContentElementWrapping {
  22.        node = ${this[itemName].__node}
  23.      }
  24.   }
  25. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top