I've created a custom property editor and using it as a macro parameter. The property renders fine and shows everything as it should.
The issue that I have is with the saving and deserialization of the property data. The data gets saved as the JSON parsed into a html string.
My JSON object {test: "pass"}
gets converted into {"test":"pass"}
.
Up until the submit, everything is as it should be, but when the submit button is pressed, the html string is what gets passed to the /umbraco/backoffice/UmbracoApi/Macro/GetMacroResultAsHtmlForEditor
endpoint.
Here is what my package.manifest
looks like:
{
propertyEditors:
[
{
alias: "propertyAlias",
name: "Property Name",
icon: "icon-code",
isParameterEditor: true,
editor:
{
valueType: "JSON",
view: "path/to/editor"
}
}
],
javascript:
[
"path/to/controller"
]
}
I've tried playing around with the valueType
property, but that doesn't do anything... the request always gets sent as shown above.