Last active
March 28, 2018 15:18
-
-
Save Sebobo/67ef081369108eea361fba068682c641 to your computer and use it in GitHub Desktop.
Neos Fusion Console debug helper for Neos 3.x
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
# 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