Loading...
Area: Optimizely CMS
Applies to versions: 10 and higher
Other versions:
ARCHIVED This content is retired and no longer maintained. See the version selector for other versions of this topic.

Links

Recommended reading 
Note: This documentation is for the preview version of the upcoming release of CMS 12/Commerce 14/Search & Navigation 14. Features included here might not be complete, and might be changed before becoming available in the public release. This documentation is provided for evaluation purposes only.

In Optimizely CMS, internal links are stored in an internal permenent format meaning you can for example rename files and templates, change host names without affecting the links.

Content

Optimizely CMS does not store links in HTML, but instead stores permanent link references. When you access a reference through a property, Optimizely 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. 

Optimizely 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, Optimizely 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.

Export and Import

The export package contains links in a permanent link format when you are transferring content. It makes sure links within the package are preserved during import. If you need to use any other links than the built-in ones (for example, if you have a custom property not based on any of the ones listed in the previous section), you have to handle the conversion during export/import yourself.

API references

The EPiServer.Core.Transfer.IReferenceMap interface on your PropertyData object tells Optimizely that you need to handle permanent links. The PermanentLinkMapper 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 topics

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

Last updated: Jul 02, 2021

Recommended reading