+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / [sitefinity]guid appearing in links

[sitefinity]guid appearing in links

4 posts, 1 answered
  1. higgsy
    higgsy avatar
    336 posts
    Registered:
    05 Aug 2010
    28 Oct 2010
    Link to this post
    Hi,

    I've developed a control designer which includes a RadEditor with very basic functinality Bold / Italic / Link / Unlink. The control designer works fine, but when the content of the radeditor is rendered on the website any hyperlinks still show the sfref and the href is [sitefinity]guid

    Am i missing something?

    thanks
    higgsy
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    28 Oct 2010
    Link to this post
    Hello Alastair,

    You have to resolve the dynamic link by using LinkParser.ResolveLinks(string html).

    Best wishes,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. higgsy
    higgsy avatar
    336 posts
    Registered:
    05 Aug 2010
    28 Oct 2010
    Link to this post
    Hi Ivan,

    I've tried using the following code:

    LinkParser.ResolveLinks(this.strContent)

    But I get the error message:

    No default implementation for retrieving item URL yet. Please use delegate to handle retrieval.


    Thanks
    higgsy
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    28 Oct 2010
    Link to this post
    Hello Alastair,

    Below is a sample code that you can use

    text = LinkParser.ResolveLinks(text, this.ResolveItemUrl);
     
    private string ResolveItemUrl(string provider, Guid id, bool resolveAsAbsoluteUrl)
          {
              if (ContentManager.Providers.ContainsKey(provider))
              {
                  IContent cnt = ContentManager.Providers[provider].GetContent(id);
                  if (cnt != null)
                      return this.ResolveUrl(cnt.UrlWithExtension);
              }
              else
              {
                  SiteMapNode node = SiteMap.Provider.FindSiteMapNodeFromKey(id.ToString());
                  if (node != null)
                      return this.ResolveUrl(node.Url);
              }
              return String.Concat("Item not found: [", provider, "]", id);
     
          }


    Sincerely yours,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
    Answered
Register for webinar
4 posts, 1 answered