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

Forums / Bugs & Issues / Custom Module Url is accepting wierd characters

Custom Module Url is accepting wierd characters

4 posts, 0 answered
  1. Steve
    Steve avatar
    3037 posts
    Registered:
    03 Dec 2008
    13 Jun 2012
    Link to this post
    I'm noticing the generated urls for some of our resources are containing periods...where is it that I can tell it to filter those out?
  2. Stoimen Stoimenov
    Stoimen Stoimenov avatar
    60 posts
    Registered:
    24 Aug 2017
    14 Jun 2012
    Link to this post
    Hello Steve,

    I suspect that you creating your items using code. If your items are created using Sitefinity UI their URLs are set correctly but when creating items using code you should add the following:

    private const string UrlNameCharsToReplace = @"[^\w\-\!\$\'\(\)\=\@\d_]+";
    private const string UrlNameReplaceString = "-";
     
    item.SetValue("UrlName", new Lstring(Regex.Replace(artistName, UrlNameCharsToReplace, UrlNameReplaceString)));

    Greetings,
    Stoimen Stoimenov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Steve
    Steve avatar
    3037 posts
    Registered:
    03 Dec 2008
    14 Jun 2012
    Link to this post
    Nope, everything is created in the backend UI.  The guy entering the items put periods in the title like this (minus the quotes)

    Group 30. Article 5.

    ...and the resulting URL has periods on those places :/

    (5.0 SP1)


  4. Steve
    Steve avatar
    3037 posts
    Registered:
    03 Dec 2008
    18 Jun 2012
    Link to this post
    FYI I was also just able to make a blog post (not custom module) and it put periods in the URL
4 posts, 0 answered