I've made a custom section in backoffice in order to allow admins to create articles for a newsletter. This newsletter wont be directly on site so I do not want
to create doc types. Instead, I use the backoffice to create those articles in a custom DB.
Each article has a title and a content which I was trying to get from umbraco's TinyMCE RTE.
I was able to get it to work partially... there is not much of documentation arround so I've been strugling a bit.
Apperently the RTE works and I can get the content entered from it but a strange thing happens... my backoffice buttons (save, and others) stop working after I
navigate to that custom section where the RTE is loaded. If I start umbraco and dont enter my custom section, all works as expected... but the moment I enter the page where my RTE is, in my custom section, from then on Save buttons stop responding all over my backoffice. I guess that's some kind of a mess with angular.js I'm doing here.
It seems to has something related to the ng-form where my RTE is... some kind of validation or so, or some event been hanging loose somewhere.
I'm pretty newbie with angular.js and umbraco backoffice. I do not know in depth how this things really work.
I really need help here... the posts I've been reading do not provide much info.
// RTE.
$scope.rteArtigo = [{
view: "/App_Plugins/NewsletterSection/backoffice/newsletterManagement/rte.html",
config: {
editor: {
toolbar: ["ace", "undo", "redo", "bold", "italic", "alignleft", "aligncenter", "alignright", "bullist", "numlist", "link", "umbmediapicker", "fullscreen"],
style_formats: [{ title: "Heading 1", inline: "h1" }],
plugins: ["fullscreen"],
stylesheets: [],
dimensions: { height: 300 }
}
},
value: ""
}];
...
vm.save = function (form) {
// entered data.
var title = $scope.title;
var data = $scope.rteArtigo[0].value;
// here I use an ajax call to save data.
}
I do not use anything besides ng-click events where all is processed. Data from $scope.rteArtigo[0].value is fetched and saved in a DB.
If I take ng-form tag and include other inputs, like the title above, when my page lose focus Umbraco prompts the usual "do you want do discard changes" message... but if ng-form only has RTE editor inside it doesnt prompt.
I wonder if that is not one of the reasons my save buttons stopped working in other backoffice sections...
RTE in custom section HOW TO
Hi
I've made a custom section in backoffice in order to allow admins to create articles for a newsletter. This newsletter wont be directly on site so I do not want to create doc types. Instead, I use the backoffice to create those articles in a custom DB. Each article has a title and a content which I was trying to get from umbraco's TinyMCE RTE. I was able to get it to work partially... there is not much of documentation arround so I've been strugling a bit.
Apperently the RTE works and I can get the content entered from it but a strange thing happens... my backoffice buttons (save, and others) stop working after I navigate to that custom section where the RTE is loaded. If I start umbraco and dont enter my custom section, all works as expected... but the moment I enter the page where my RTE is, in my custom section, from then on Save buttons stop responding all over my backoffice. I guess that's some kind of a mess with angular.js I'm doing here. It seems to has something related to the ng-form where my RTE is... some kind of validation or so, or some event been hanging loose somewhere.
I'm pretty newbie with angular.js and umbraco backoffice. I do not know in depth how this things really work. I really need help here... the posts I've been reading do not provide much info.
Here's my html
Here's my js controller
I do not use anything besides ng-click events where all is processed. Data from $scope.rteArtigo[0].value is fetched and saved in a DB. If I take ng-form tag and include other inputs, like the title above, when my page lose focus Umbraco prompts the usual "do you want do discard changes" message... but if ng-form only has RTE editor inside it doesnt prompt. I wonder if that is not one of the reasons my save buttons stopped working in other backoffice sections...
I really need help here!
Regards,
Jorge
To anyone with needs to add RTE to custom section here is what I discovered:
In html use this:
in js controller use this:
That works!
JR
is working on a reply...