Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Mike 23 posts 86 karma points
    Mar 04, 2014 @ 16:16
    Mike
    0

    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)?

  • David Brendel 792 posts 2970 karma points MVP 3x c-trib
    Mar 11, 2014 @ 17:05
    David Brendel
    0

    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:

    $scope.myProperty = {
            label: 'bodyText',
            description: 'Load some stuff here',
            view: 'rte' 
    };
    

    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.

Please Sign in or register to post replies

Write your reply to:

Draft