SaaS CMS has officially launched! Learn more now.

TinyMCE - Avoid href auto-prepend


I have a URL which I would like to add via @Model.Url in the TinyMCE rich text editor (not ideal I know). See image below. However Episerver CMS always auto prepends "/Episerver/CMS" to the link which turns the link invalid. Any way to avoid this behavior

Sep 28, 2020 19:39

TinyMCE adds this if your link does not start with a / or http:// or https:// or similar.

You can override this value by setting document_base_url:

You could also probably control this by adding your own callback method:

Or you could hook into the ContentSaving content-event and replace "/EPiServer/CMS/@" with "@" when the content is saved.

Sep 28, 2020 20:14

Why don't you just inject complete anchor tag from backend for some placeholder string like for example $$anchor?

Sep 29, 2020 10:10
* 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.