Tuesday, October 25, 2011

RTE not displaying links as GUID

Often we encounter issue where Sitecore Link in RTE is presented in GUID instead its SEO friendly URL. Sitecore by default do render Sitecore Link in RTE in GUID, this is so as to allow movement of the targeted item within the content tree without the need to change the RTE itself. Fortunately Sitecore OOB also support the functionality to convert this GUID link to its SEO friendly URL.

There are two ways to achieve this,

1. Using sc:html instead for example sc:text
2. Using the following code global::Sitecore.Links.LinkManager.ExpandDynamicLinks(value, true);

I personally prefer the first approach whenever possible just because it involves the least amount of coding work.

No comments:

Post a Comment