Try our conversational search powered by Generative AI!

Loading...
Area: Optimizely CMS
ARCHIVED This content is retired and no longer maintained. See the latest version here.

Recommended reading 

Rename files and templates without affecting the links, and move an EPiServer CMS site from a virtual directory to a root site without breaking a single link. 

Content

EPiServer CMS does not store links in HTML, but instead stores permanent link references. When you acccess a reference through a property, EPiServer CMS resolves the reference to an actual link so you see an HTML link in the content. When you save the content, the property parses the HTML and stores a permanent link.

NOTE: You can paste a permanent URL into a web browser for debugging. 

EPiServer CMS preserves additional URL segments and query parameters (after the content-specifying part of the URL) when it converts a permanent link. So, you can link to a specific action on a controller (potentially with parameters) or something routed by a partial router. A registered route must match the URL.

Built-in properties

Many of the built-in types such as Url (corresponding to PropertyUrl and PropertyImageUrl properties), XHtmlString (corresponding to PropertyXhtmlString) and LinkItemCollection (corresponding to PropertyLinkItemCollection) support permanent links. However, the basic string (corresponding to ProperyString/PropertyLongString) does not support permanent links because it may contain formats other than HTML. Use the XhtmlString for all HTML content to make use of permanent links.

Link integrity tracking

When you save a content instance, EPiServer CMS parses the properties (such as PropertyUrl, PropertyXhtmlString, PropertyLinkItemCollection, and PropertyContentArea) for links to other content instances or files, and stores the references in a reference table to track the items that link to each other.

Web services and RawContent/RawPage/RawProperty

The raw data transfer types only expose the permanent links when you are transferring content (primarily by Web Services and mirroring/export/import). If you need to use any other links, you have to handle the conversion between the Page object to the RawPage object yourself or add post-processing.

API references

The EPiServer.Core.Transfer.IReferenceMap interface on your PropertyData object tells EPiServer that you need to handle permanent links. The Permanent Link Mapper handles conversion between permanent links and dynamic links. Access the API using the EPiServer.Web.PermanentLinkUtility class. The EPiServer.Web.IPermanentLinkMapper and EPiServer.Web.PermanentLinkMap classes are underlying components in the PermanentLink architecture and you typically do not need to access them directly.

Content links references

Permanent links to content consist of the GUID associated with a content, also available as the property IContent.ContentGuid.

Definition: ~/link/ContentGUID.extension?EXTRAINFO.

Related topic

Do you find this information helpful? Please log in to provide feedback.

Last updated: Feb 23, 2015

Recommended reading