I want to create a new property editor for macro parameter using the umbraco tinymce rte editor. I have not been able to do it successfully.
This is what I've done so far:
- Created a new folder in the App_Plugins folder named RichTextMacro
- Created a new package.manifest file
{
propertyEditors: [{
alias: "RichTextMacro",
name: "RichTextMacroEditor",
isParameterEditor: true,
editor: {
view: "~/App_Plugins/RichTextMacro/RichTextMacro.html",
valueType: "TEXT"
}
}
],
javascript: [
"~/App_Plugins/RichTextMacro/RichTextMacro.controller.js"
]
}
- created a new RichTextMacro.controller.js
angular.module("umbraco")
.controller("Macro.RichTextMacro",
function ($scope) {
$scope.textInput = {
label: 'bodyText',
description: '...',
view: '/umbraco/views/propertyeditors/rte/rte.html',
value: $scope.model.value,
config: {
editor: {
toolbar: ["ace", "undo", "redo", "cut", "styleselect", "bold", "italic", "alignleft", "aligncenter", "alignright", "bullist", "numlist", "link", "umbmediapicker", "umbmacro", "umbembeddialog"],
stylesheets: [],
dimensions: {
height: 200
},
mode: 'classic'
}
}
};
$scope.$watch('textInput.value', function (newValue, oldValue) {
$scope.model.value = newValue;
});
});
- Created a new RichTextMacro.html
<div ng-controller="Macro.RichTextMacro">
<div style="border: 1px solid #ccc">
<ng-form>
<umb-editor model="textInput"></umb-editor>
</ng-form>
</div>
</div>
I keep getting an error about the controller not being registered. Please anybody help!!!!
question from:
https://stackoverflow.com/questions/65836584/how-to-use-rich-text-editor-as-macro-paramter-on-umbraco-v8 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…