Try our conversational search powered by Generative AI!

Delay/Call On Page Edit initialization from Javascript


I'm looking for a way to tell the on page editing initialization to wait a minute until I'm done with rendering the page. Some of our pages make Ajax requests for content, and when that content comes in the on page editing is already initialized and it's not possible to edit the new content.

Is there any API I can use to tell EPiServer to wait, or to look again for new editable content?

Another option would be if someone could tell me what event EPiServer (dojo) listens to to start the initilization so that I could override it and trigger it manually when I'm done. Is it the "load" event on the iframe?

Oct 15, 2015 8:57

contentContextChanged ( ctx , callerData )


Oct 15, 2015 15:32

You can also try subscribing to the "/epi/shell/context/current" topic. This is broadcast when the current context has changed so will fire each time the editor selects some new content. I use this as part of the MenuPin initialisation so you may find some inspiration from the implementation:

Oct 15, 2015 21:41

Thanks a lot for the suggestions! Here's where I've gotten so far:

    function (contentContextMixin) {
        var widget = window.parent.dojo.declare([contentContextMixin], {
            initialize: function () {

                var self = this;
                window.parent.triggerRef = function() {
        new widget().initialize();

When I invoke something in the preview iframe that loads new content with Ajax (and the content shows up correctly, but the block controls from EPiServers UI are missing) i run "triggerRef()" manually in DevTools. But nothing seems to happen. I'm sure I'm doing something wrong here, could anyone point me in the right direction?

Oct 16, 2015 8:25
* 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.