Take the community feedback survey now.

Integrating LinkEditor and TinyMCE into a custom admin Dojo widget

Vote:
 

I'm creating a custom editor that involves editing complex objects that include (among other things) XhtmlStrings and LinkItemCollections. Unfortunately, I'm not finding any easy way to actually include the out-of-the-box Optimizely editors for those. I do have ContentSelector working for ContentReferences, however.

Here's an example of what I've tried for the LinkEditor.

define([
    "dojo/_base/declare",
    "dojo/_base/lang",
    "dijit/_WidgetBase",
    "dijit/_TemplatedMixin",

    // built React component
    "./ReactComponent",

    // widgets
    "epi-cms/widget/ContentSelector",
    "epi-cms/widget/LinkEditor",

    // mixins
    "epi/shell/widget/_ModelBindingMixin",

    // dependency resolution
    "epi/dependency",
], function (
    declare,
    lang,
    _WidgetBase,
    _TemplatedMixin,
    ReactComponent,
    ContentSelector,
    LinkEditor,
    _ModelBindingMixin,
    dependency,
) {
    return declare([_WidgetBase, _TemplatedMixin, _ModelBindingMixin], {
        templateString: `
        <div>

            <div data-dojo-attach-point="reactContainer">React component failed to render :(</div>
            <div class="custom-link-editor-widget" style="padding: 5px; border: 1px solid black">
                <div data-dojo-attach-point="linkEditorNode"></div>
            </div>
        </div>`,

        buildRendering: function () {
            this.inherited(arguments);
        },
        postCreate: function () {
            this.inherited(arguments);

            this.linkEditor = new LinkEditor({
                // value: [],
                allowedTypes: ['episerver.core.page'],
                intermediateChanges: true,
                name: 'test'
            });

            this.linkEditor.placeAt(this.linkEditorNode);
            this.linkEditor.startup();
        }
// ...
    });
});

However, when I run this.linkEditor.startup(), I get this:

"Uncaught TypeError: can't access property "properties", _1442 is null"

 

Does anyone have any advice on the best way to include the LinkEditor and the TinyMCE XhtmlString editor in a custom admin editor?

#339621
Jul 10, 2025 17:57
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.