Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi guys/gals
Im doing some custom sections and been happy with angular, however some of the buildin property editors for umbraco is really hard to figure out!
Currently i have an RTE i want to reuse, my code is like so:
Editor
<umb-property property="property" ng-repeat="property in rteProperties"> <umb-editor model="property"></umb-editor> </umb-property>
JS:
$scope.text = ""; $scope.rteProperties = [{ label: 'label', description: 'desc', view: 'rte', value: $scope.text, config: { editor: { readonly: true, toolbar: [], stylesheets: [], dimensions: { height: 400 } } } }];
Can you give me some pointers why the text in $scope.text is not updating when updating the tinymce editor ?
Hi!
You can't set the value to a variable as it's already a variable.
Basiclly the value of the RTE in your case will be stored in $scope.rteProperties.value - if you need a initial value you would set that like this:
$scope.rteProperties.value = 'This is my initial value'
Then when you want to store it / read the value
var myRteValue = $scope.rteProperties.value
I wrote a blog post about this some years ago but it should still be relevant: http://www.enkelmedia.se/blogg/2013/12/4/umbraco-7-use-the-rich-text-editor-tinymce-in-a-custom-section.aspx
Hope this helps!
Hello Markus
Thank you for the answer, i was using that blog earlier where this was one of the options, really appreciate the effort!
I was thinking in knockout mode where one would make a binding for an editor and pass in the observable to use.
The answer ended up being $scope.rteProperties[0].value that returned the correct value.
Thank you for the help, still new to these custom sections but they are growing on me, angular is very powerful :)
Great news =D
Yes, your right! $scope.rteProperties[0].value is the why to go =D Forgot about the array.
Cheers!
// m
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
RTE Property not updating in custom section
Hi guys/gals
Im doing some custom sections and been happy with angular, however some of the buildin property editors for umbraco is really hard to figure out!
Currently i have an RTE i want to reuse, my code is like so:
Editor
JS:
Can you give me some pointers why the text in $scope.text is not updating when updating the tinymce editor ?
Hi!
You can't set the value to a variable as it's already a variable.
Basiclly the value of the RTE in your case will be stored in $scope.rteProperties.value - if you need a initial value you would set that like this:
$scope.rteProperties.value = 'This is my initial value'
Then when you want to store it / read the value
var myRteValue = $scope.rteProperties.value
I wrote a blog post about this some years ago but it should still be relevant: http://www.enkelmedia.se/blogg/2013/12/4/umbraco-7-use-the-rich-text-editor-tinymce-in-a-custom-section.aspx
Hope this helps!
Hello Markus
Thank you for the answer, i was using that blog earlier where this was one of the options, really appreciate the effort!
I was thinking in knockout mode where one would make a binding for an editor and pass in the observable to use.
The answer ended up being $scope.rteProperties[0].value that returned the correct value.
Thank you for the help, still new to these custom sections but they are growing on me, angular is very powerful :)
Great news =D
Yes, your right! $scope.rteProperties[0].value is the why to go =D Forgot about the array.
Cheers!
// m
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.