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

Forums / Developing with Sitefinity / URL to lower case

URL to lower case

6 posts, 0 answered
  1. Daniel Plomp
    Daniel Plomp avatar
    952 posts
    Registered:
    18 Feb 2004
    19 Jul 2010
    Link to this post
    Hi all,

    The properties 'UrlWithExtension' and 'Url' of an IContent item are not lower case. How can I make these URL's lower case?

    Thanks,
    Daniel
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    19 Jul 2010
    Link to this post
    Hello Daniel,

    You can use .ToLower() in the context where you use these properties.

    Greetings,
    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. Daniel Plomp
    Daniel Plomp avatar
    952 posts
    Registered:
    18 Feb 2004
    19 Jul 2010
    Link to this post
    I understand. But what to do if you use the ContentView and all is generated automatically?

    Regards,
    Daniel
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    19 Jul 2010
    Link to this post
    Hi Daniel,

    You could create a rules and rewrite the title of the content item in the url. In this case you should use AdvancedUrlRewriter and you should crate a rule for each letter.

    The second option is to change the fullContent url of the ContentView control using .ToLower(). You need to override the control and its SetItemContent where you can access fullContent ulr and set the NavigateUrl property.

    string navUrl = GetItemUrl(contentItem, SingleItemUrl);
     for (int i = 1; i < 6; i++)
     {
         ctrl = FindContentViewControl("fullContent" + i, itemContainer);
         if (ctrl is HyperLink)
         {
             ((HyperLink) ctrl).NavigateUrl = navUrl.ToLower();
     
           }
        }


    Kind regards,
    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
  5. Daniel Plomp
    Daniel Plomp avatar
    952 posts
    Registered:
    18 Feb 2004
    19 Jul 2010
    Link to this post
    Thanks. I'll go for the second option.

    -Daniel-
  6. Shawn
    Shawn avatar
    79 posts
    Registered:
    26 Sep 2012
    11 Nov 2010
    Link to this post
    Take a look at http://sitefinityauthority.com/post/11-10-10/lowercase-urls-and-regular-expressions-in-sitefinity.aspx.  Is this what you're shooting for?

Register for webinar
6 posts, 0 answered