How to change size of the Insert Sitecore Media and Insert Sitecore Link dialogs in the Rich Text Editor


Description

On smaller screens, the Insert Sitecore Media and Insert Sitecore Link dialogs in the Rich Text Editor extend beyond the viewport, hiding the Insert and Cancel buttons and preventing users from confirming their selections.

Solution

To change dialog dimensions, edit sitecore/shell/Controls/Rich Text Editor/RichText Commands.js file. Locate the InsertSitecoreLink and InsertSitecoreMedia commands and change height and/or width parameter to a value that fits the viewport of the affected device.

For example:

  1. Create a backup of the sitecore\shell\Controls\Rich Text Editor\RichText Commands.js file.
  2. Set the height and/or width for InsertSitecoreLink and InsertSitecoreMedia commands.
    For example, to change the Insert Sitecore Link dialog size to 1000 pixels wide and 500 pixels tall use:
    Telerik.Web.UI.Editor.CommandList["InsertSitecoreLink"] = function (commandName, editor, args) {
       ...
      editor.showExternalDialog(
        "/sitecore/shell/default.aspx?xmlcontrol=RichText.InsertLink&la=" + scLanguage + "&fo=" + id + (scDatabase ? "&databasename=" + scDatabase : ""),
        null, //argument
        1000,
        500,
        scInsertSitecoreLink, //callback
        null, // callback args
        "Insert Link",
        true, //modal
        Telerik.Web.UI.WindowBehaviors.Close, // behaviors
        false, //showStatusBar
        false //showTitleBar
      );
    };
  3. Clear the browser cache to ensure the RichText Commands.js file is reloaded with new values.