More in this section

Forums / Developing with Sitefinity / Parse dynamic Url in complexe string

Parse dynamic Url in complexe string

3 posts, 0 answered
  1. Pierre
    Pierre avatar
    433 posts
    Registered:
    16 Feb 2006
    16 Oct 2009
    Link to this post
    Hi Team,

    I use RadEditor and link Manager to add complexes models. The links are mixed in the text paragraphs. I use later these Content.text in one database to render late as string. Exist some easier way to parse the internal dynamics links like []guid mixed in my string to normal link. Normal you can use GetUrl but in one complex string how to?.
    Regards.
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    17 Oct 2009
    Link to this post
    Hello Pierre,

    You can get the editor content as text and check whether it contains links and their types. For instance:

    if (urlValue.StartsWith("~/"))
                // This is not a dynamic link
                return this.ResolveUrl(value);
            if (urlValue.StartsWith("["))
            {
               // This is Sitefinity's dynamic url
            }

    Regards,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. Pierre
    Pierre avatar
    433 posts
    Registered:
    16 Feb 2006
    17 Oct 2009
    Link to this post
    Hi Ivan

    Thanks, finally i have found this expression. I parse my string chain using

    //textWithDynamicLinks is the html containing the sfref attribute    
    string resolvedLinksHtmlLinkParser.ResolveLinks(textWithDynamicLinks, this.GetItemUrl, null, false, false);    
     
     

    Good We. Romi
Register for webinar
3 posts, 0 answered