We are using the lovely Contentment package from Mr Lee K in conjunction with UI builder to help display a record/audit of important requests we send out from the site.
We are using the the Umbraco.Community.Contentment.CodeEditor property editor to help display the JSON of the payload we send out to a service and the JSON payload we receive back from the service.
The DB table has the raw JSON string on a single line, but I was wondering if there was a way for the code editor to pretty print or format my JSON for me, as nicely indented JSON.
Do you actually want to format the data, or just have a friendlier view of it?
If it’s not for editing then a custom property “editor” would be straightforward, parse and stringify with JS then render in a pre tag with highlight.js
Yeh that might be a good shout to do Jason, as no we don’t need to modify the value as its read only.
Sounds like I am off to create a simple property editor view then, I was just being lazy and trying to use some of the stuff that we have here in this project and seeing if it could be bent a little to do what we needed.
Hi Lee,
Yep it is V13, sorry I should have made it clearer. I only tagged the post with V13 so perhaps its not so obvious…
Anyway I LOVE the idea of the templated list and this quick approach without me having to scratch my head on writing AngularJS code again after my head has adjusted to WebComponent land.