Category Archives: ImageVault

Adding ImageVault buttons to TinyMCE 2 in Episerver

With the new TinyMCE version in Episerver 11, there are some new changes on how to set up your toolbars.

Episerver has documented it quite well and how you set it up in the back end is quite similar to how you would set it up using TinyMCE’s JavaScript API.

But it took a while until I could find how to add my ImageVault buttons.

Finally I found that I need to add these:

  • imagevault-insert-media
  • imagevault-edit-media

They will give you the ImageVault buttons you’ve always been waiting for!

Workaround that ImageVault.EPiServer.UI 5.5.36 does not support non-standard ports

We have upgraded the NuGet package ImageVault.EPiServer.UI to 5.5.36.

This package is used to install ImageVault properties and editor UI into Episerver.

However I noticed that I was unable to add images to the ImageReference properties in Episerver. The “Insert” button was replaced with “Publish”.

iv insert.png

Looking into the javascript errors I found the following:

imagevault-insert-media.min.js:1 Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://my-imagevault-core') does not match the recipient window's origin ('https://my-imagevault-core:9901').

As we’re hosting our ImageVault Core on a non-standard port 9901 it looked like something was lost.

Browsing the zip packaged containing the ImageVault UI resources I found the javascript imagevault-insert-media.min.js that it does not include the port when defining the origin.

Patching it up

It was easy to patch the .js file but since I did not want to fool around with the .zip package, I needed to find another way to override the file.

Creating a HttpHandler that listened to the path for the original file, and returning my modified file instead it’s easy for me to implement my fix without the risk of it being overriden. It’s also easy to remove when the fix is patched!

If you need help

If you also experienced this issue, you can find my patch on

As it would only be a temporary patch, I don’t think it’s worth creating a nuget package for it.

This is reported to Meriworks, but I hope that this helps you if you encountered the same problems.