Answer the question
In order to leave comments, you need to log in
Bitrix visual editor - content wrapper?
It is necessary to wrap any content that is changed through the Bitrix visual editor in a kind of wrapper. <div class="custom-content">....</div>
There is practically no description of the visual editor API.
The solution zombzone.ru/?p=82 based on the 'OnIncludeHTMLEditorScript' event does not work in the hermitage in the 16th version of Bitrix.
I tried this option. Event fulfills on opening of the editor. But I have not yet been able to find how to intercept the installation of content.
BX.addCustomEvent('OnEditorInitedBefore', function (toolbar) {
console.log(this)
});
Answer the question
In order to leave comments, you need to log in
In general, I found the solution myself. If anyone needs it.
<script>
BX.addCustomEvent('OnEditorInitedBefore', function () {
if (this.config.content.indexOf('<div class="custom-contet">') == -1) {
this.config.content = '<div class="custom-contet">' + this.config.content + '</div>';
}
});
</script>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question