Documentation
Editor
focus
Type: Boolean
Default: false
By default, Redactor X doesn't receive focus on load, because there may be other input fields on a page. However, to set focus to the editor, you can use this setting:
RedactorX('#entry', {
editor: {
focus: true
}
});
drop
Type: Boolean
Default: true
This setting allows you to turn off drag or drop images or any other elements in Redactor X.
RedactorX('#entry', {
editor: {
drop: false
}
});
sync
Type: Boolean
Default: true
By default, Redactor X synchronizes the visual layer with the textarea in which it creates the output html each time the content is changed. This can be turned off to improve performance.
RedactorX('#entry', {
editor: {
sync: false
}
});
add
Type: String
Default: top
This setting defines where content will be inserted if there is no focus in Redactor X. There are two options: top - at the beginning of the editor, bottom - at the end of the editor content.
RedactorX('#entry', {
editor: {
add: 'bottom'
}
});
lang
Type: String
Default: en
By default, Redactor X is set to English language, but you can download (or create) and install your own language file. All you need is to set a language file after redactorx.js
:
<script src="/js/redactorx/redactorx.js"></script>
<script src="/js/redactorx/es.js"></script>
And then set the lang option like this:
RedactorX('#entry', {
editor: {
lang: 'es'
}
});
scrollTarget
Type: String
, Node
Default: document
If the editor is in the parent layer, which has its own scrolling, regardless of the page scrolling, then you need to specify the ID of this layer in this setting.
RedactorX('#entry', {
editor: {
scrollTarget: '#my-scroll-layer'
}
});
direction
Type: String
Default: ltr
Redactor X supports both right-to-left and left-to-right text directions. By default, the editor is set to work with left-to-right, to set it to right-to-left, use direction setting:
RedactorX('#entry', {
editor: {
direction: 'rtl'
}
});
spellcheck
Type: Boolean
Default: true
This setting allows to turn off a browser spell checking for Redactor X.
RedactorX('#entry', {
editor: {
spellcheck: false
}
});
grammarly
Type: Boolean
Default: false
This option allows to turn on Grammarly spell check for Redactor X.
RedactorX('#entry', {
editor: {
grammarly: true
}
});
notranslate
Type: Boolean
Default: false
This option allows to disable Google Translate to translate content of Redactor X.
RedactorX('#entry', {
editor: {
notranslate: true
}
});
minHeight
Type: String
Default: 100px
This setting allows to set minimum height for the editor.
RedactorX('#entry', {
editor: {
minHeight: '300px'
}
});
maxHeight
Type: Boolean
, String
Default: false
This setting allows to set maximum height for Redactor X.
RedactorX('#entry', {
editor: {
maxHeight: '800px'
}
});
enterKey
Type: Boolean
Default: true
This setting disables pressing enter key.
RedactorX('#entry', {
editor: {
enterKey: false
}
});