I have been reading through the Umbraco 7 Belle documentation for a while, trying to figure out how I set up a basic edit form to set up a number of fields from a JSON object returned from a controller, but I keep coming up stuck.
I have my controller and resource JS files set up to read in my custom object, and I am able to display the contents of this object in a text box or a paragraph tag easily enough, but I am confused as to how I handle the field descriptions (i.e. the bits of text that describe what a field does).
Do I need to hard-code field labels into my edit.html template, or is this handled through the package.manifest file? If the latter, is there an easy way to map a value from a JSON value to a given data type (i.e. "True" to a true/false view)?
Building an edit form from a custom object
I have been reading through the Umbraco 7 Belle documentation for a while, trying to figure out how I set up a basic edit form to set up a number of fields from a JSON object returned from a controller, but I keep coming up stuck.
I have my controller and resource JS files set up to read in my custom object, and I am able to display the contents of this object in a text box or a paragraph tag easily enough, but I am confused as to how I handle the field descriptions (i.e. the bits of text that describe what a field does).
Do I need to hard-code field labels into my edit.html template, or is this handled through the package.manifest file? If the latter, is there an easy way to map a value from a JSON value to a given data type (i.e. "True" to a true/false view)?
Don't exactly know what you want to achive but you can use umbraocs directives to display your data with the right views.
The directive is this one:
<umb-editor model="myProperty"></umb-editor>
.Your property then needs some config values:
With the view property you can specify that it should be a rte or an true/false or whatever.
Then you only have to get the value out of it when saving.
Or you built all your controls on your own. If you got some special editors you want to use like some jquery plugins or similar.
is working on a reply...