Skip to content

Instantly share code, notes, and snippets.

@Sebobo
Last active March 28, 2018 15:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Sebobo/67ef081369108eea361fba068682c641 to your computer and use it in GitHub Desktop.
Save Sebobo/67ef081369108eea361fba068682c641 to your computer and use it in GitHub Desktop.
Neos Fusion Console debug helper for Neos 3.x
##
# This object will output fusion variables to the browser console.
#
# Example usage:
#
# @process.addDebugOutput = Shel.Helper:Debug {
# output = ${node.identifier}
# }
#
# Which will prepend the current node oder document node label by default.
#
# To have a custom title do this:
#
# @process.addDebugOutput = Shel.Helper:Debug {
# title = 'My node identifier'
# output = ${node.identifier}
# }
#
prototype(Shel.Helper:Debug) < prototype(Neos.Fusion:Value) {
value = ${value}
title = ${node ? node.label : (documentNode ? documentNode.label : 'Untitled')}
output = ''
@process.addDebugOutput = ${value + '<script>console.log("' + this.title + ':",' + Json.stringify(this.output) + ');</script>'}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment