Parameter json formatting

Hello,

once in a while when working on component parameters (but also when working on JSON for loopers) it happens that the formatting changes from an easier readable version:

{
  "text" : {
    "label"   : "Text",
    "type"    : "text",
    "initial" : "Click Me"
  },
  "link" : {
    "label"   : "Link",
    "type"    : "text",
    "initial" : "#"
  }
}

to a one line version which is harder to read (and edit):

{"text":{"label":"Text","type":"text","initial":"Click Me"},"link":{"label":"Link","type":"text","initial":"#"} }

I can’t say when this happens exactly. For me it was like about a few hours after not using cornerstone (back to WP dashboard) and continuing editing the parameters or looper json the next day.

Is there a way to avoid this or a way to reformat quickly within cornerstone?

Using ChatGPT for this task every time is a bit annoying :slight_smile:

best regards
Mirco

I can’t tell you why the json has now been minimized, and there is no special editor in cornerstone.

But I use the online json editor, for example, which also shows you any errors, see screenshot. Very good for long JSON that would otherwise be unreadable.

https://jsoneditoronline.org/

Personally, I use the Smart JSON Editor if you have a MAC. I have also saved all the templates from theme.co in this editor for quick use in new projects.

http://www.smartjsoneditor.com/

I hope I was able to help.

1 Like

Thanks @Regnalf,

I’m going to look into the tools you mentioned. That will help for sure, especially for long JSON.

Was just hoping there is a way within cornerstone (either by turning on/off some preferences) that I missed or some sort of “reformat”-button at the JSON editor.

best regards
Mirco

1 Like

Hey Mirco,

Thanks for reaching out!

We are not able to replicate this JSON formatting issue on our development website but I’ll let our developer knows about what you’re currently experiencing .

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.