Revisited: Extending Episerver link in TinyMCE to support anchors on page

PLACE FOR BLOG

Revisited: Extending Episerver link in TinyMCE to support anchors on page

Revisited: Extending Episerver link in TinyMCE to support anchors on page

marija

A couple of years ago, I wrote a post about how to support linking to an anchor on a different Episerver page. This was much read post according to Analytics and the solution was seemingly used here and there in the community. Now, I think it's time it retires. This posts explains why.

To put it simply, Episerver now has a better out-of-the-box solution. Linking to an anchor can now be achieved through selecting a page and adding ex. #anchor-on-page in a Remaining Url text field (see a gif in "Internal links can now contain query string" section in Arild's blog). While not as editorially friendly as the one implemented above, it benefits from:

  • No extra development effort needed
  • Works for LinkItemCollection, Url or a link in TinyMCE
  • Doesn't introduce any maintenance costs
  • Doesn't have any upgrade risks (other than the ones always coming from an upgrade).

The benefit of the old solution now becomes the fact that the dropdown list is populated with anchors from the selected page, so that the editor doesn't have to remember the hash. But then again, remembering the hash seems to be a fair trade-off, I think, compared to the benefits of built-in solution.

Please note that JP @ Episerver upgraded the old code to work with the new TinyMCE (thx a lot!!). However, the solution still needs some love when editing the previously set page+anchor, since Remaining Url gets in the way and opens some more questions on the role of remaining URL vs the anchor - their purpose now collides. (I will not fix this unless there is some interest on github after reconsidering the use for the plugin.)

LEAVE A COMMENT