Change in editor_plugin.js for the extended EPiServer link that support anchors for 7.19.2

PLACE FOR BLOG

  • Home
  • /
  • Blogs
  • /
  • marija's blog
  • / Change in editor_plugin.js for the extended EPiServer link that support anchors for 7.19.2
Change in editor_plugin.js for the extended EPiServer link that support anchors for 7.19.2

Change in editor_plugin.js for the extended EPiServer link that support anchors for 7.19.2

marija

I've previously written about extending the link functionality to enable linking to the specific part of the page and not only to its top. Now, EPiServer have changed something in the hyperLinkSelector widget, so the js file needs some small modifications. Another improvement is that I have put the code to github, it's easier to enable the plugin and I've taken the latest version of epilink and started from there, so if anything was fixed, it's applied to this widget as well.

Related blogs

  1. Overwriting the EPiServer link in TinyMCE to support linking to the specific part of page
  2. Hooking to a page dojo widget inside EPiServer TinyMCE link

Changes explained

Now, the editor plugin is slightly changed to this one. The updates are tested on the version 7.19.2.

These is the part of packages.config against which I've tested this version of the plugin:

  1. Episerver.CMS - 7.16.1
  2. Episerver.CMS.Core - 7.19.2
  3. Episerver.CMS.UI - 7.19.1

Most probably it would work on versions between 7.11 and this one, but I haven't had time to test this, so let me know if you stumble upon issues if using it on other versions and I'll help you fix it.

Plugin on github

The plugin is now available on github.

AnchorService and AnchorController working example

I've refactored the AnchorService, so it's easier to immediately try it out. Should you need the logic that loads all anchors from XHtml, the recommendation is to fetch the anchors in a different way, by using ex. HtmlAgilityPack.

To make the AnchorController work, call install-package Microsoft.AspNet.WebApi in the package management console.

LEAVE A COMMENT