Editor config

Description

The editorConfig section allows to change the parameters pertaining to the editor interface: opening mode (viewer or editor), interface language, additional buttons, etc.).

Parameters
Name Description Type Example
Specifies URL to the document storage service (which must be implemented by the software integrators who use ONLYOFFICE Document Server on their own server). string "http://example.com/url-to-callback.ashx"
Defines the URL of the document where it will be created and available after creation. If not specified, there will be no creation button. string "http://example.com/url-to-create-document/"
Defines the editor interface language (if some other languages other than English are present). Is set using the two letter (de, ru, it, etc.) or four letter (en-US, fr-FR, etc.) language codes. The default value is "en-US". string "en-US"
Defines the editor opening mode. Can be either view to open the document for viewing, or edit to open the document in the editing mode allowing to apply changes to the document data. The default value is "edit". string "edit"
Defines the presence or absence of the documents in the Open Recent... menu option where the following document parameters can be set:
  • folder - the folder where the document is stored (can be empty in case the document is stored in the root folder),
    type: string,
    example: "Example Files";
  • title - the document title that will be displayed in the Open Recent... menu option,
    type: string,
    example: "exampledocument1.docx";
  • url - the URL to the document where it is stored,
    type: string,
    example: "http://example.com/exampledocument1.docx".
array of object
Defines the user currently viewing or editing the document:
  • firstname - the first name of the user. Deprecated since version 4.2,
    type: string,
    example: "John";
  • id - the identification of the user,
    type: string,
    example: "78e1e841";
  • lastname - the last name of the user. Deprecated since version 4.2,
    type: string,
    example: "Smith";
  • name - the full name of the user. Used since version 4.2,
    type: string,
    example: "John Smith".
object
* - required field
Example
var docEditor = new DocsAPI.DocEditor("placeholder", {
    "editorConfig": {
        "callbackUrl": "http://example.com/url-to-callback.ashx",
        "createUrl": "http://example.com/url-to-create-document/",
        "lang": "en-US",
        "mode": "edit",
        "recent": [
            {
                "folder": "Example Files",
                "title": "exampledocument1.docx",
                "url": "http://example.com/exampledocument1.docx"
            },
            {
                "folder": "Example Files",
                "title": "exampledocument2.docx",
                "url": "http://example.com/exampledocument2.docx"
            },
            ...
        ],
        "user": {
            "id": "78e1e841",
            "name": "John Smith"
        }
    },
    ...
});

Where the example.com is the name of the the server where document manager and document storage service are installed. See the How it works section to find out more on Document Server service client-server interactions.