Umbraco7 uses the DataType of the homebrew

  
Umbraco7

Described how to use the own DataType.

I think adding a DataType in shape different from 6 in the Umbraco7 way to leave.

The following file makes umbraco App_Plugin folder.

  • /App_Plugin/MyDatatype/package.manifest
  • /App_Plugin/MyDatatype/mydatatype.html
  • /App_Plugin/MyDatatype/mydatatype.controller.js

customdatatype1.png

package.manifest

{
    //you can define multiple editors
    propertyEditors: [
        {
            /*this must be a unique alias*/
            alias: "Test.MyDatatype",
            /*the name*/
            name: "MyDatatype Dayo",
            /*the html file we will load for the editor*/
            editor: {
                view: "~/App_Plugins/MyDatatype/mydatatype.html"
            }
        }
    ]
    ,
    //array of files we want to inject into the application on app_start
    javascript: [
        '~/App_Plugins/MyDatatype/mydatatype.controller.js'
    ]
}

mydatatype.html

<div ng-controller="Test.MyDatatypeController">
    <textarea ng-model="model.value"></textarea>
</div>

mydatatype.controller.js

angular.module("umbraco")
    .controller("Test.MyDatatypeController",
    function () {
        alert("The controller has landed");
    });

Restart the server once you create these files, open the file management screen.

customdatatype2.png

Try specify this data type to document type.

customdatatype3.png

And actually take a look at content from the content section.

customdatatype4.png

comments powered by Disqus
search