0

When adding a external url on my LinkItemCollection, EpiServer converts it to a internal page. Is there a way to disable this function?

Using Episerver 7.

dhilt
  • 18,707
  • 8
  • 70
  • 85
Gonzalo
  • 322
  • 1
  • 3
  • 13
  • How are you adding the link? – Ted Nyberg Jan 02 '18 at 12:33
  • To a LinkItems external Url: www.mysite.se but when publishing EpiServer changes to an internal page e.g My startpage – Gonzalo Jan 02 '18 at 13:53
  • We do this because the page URL might change and if we're trying to help out by making sure the link will continue working in that case. Can you explain a bit more about what you'd like to achieve without a content reference? – John-Philip Jan 19 '18 at 16:05

1 Answers1

2

LinkItem require you to invoke the method ToMappedLink or ToPermanentLink when working with external links.

https://world.episerver.com/documentation/class-library/?documentId=cms/7/ac6ab436-b0bb-3f26-dce4-b79230339d79

enter image description here

Eric Herlitz
  • 25,354
  • 27
  • 113
  • 157
  • Yes but can i override those methods so it doesnt convert to internal episerver pages when the url matches the host name. If yes, how? – Gonzalo Jan 03 '18 at 12:27