Lowercase URLs

Jul 1, 2010 at 11:44 PM

Hello,

Would it be possible to have an option to do a ToLower() on all URLs coming out of the html helpers? It seems like a more elegant solution than decorating all of my actions and controllers with lowercase names. I realize there are already 12 overloads for the menu helper, so if this isn't something that's desired in the trunk, would it be possible to somehow extend the helpers from outside of the main project?

Thanks for all of the great work!

-Derek

Coordinator
Jul 2, 2010 at 7:05 AM

Not sure if everyone will want this behaviour.

I have some options to choose from :-)

- I add another series of overloads
- An extra configuration value for the provider, i.e. "lowerCaseUrls"
- An extra extensibility point: have a SiteMapNodeUrlResolver which you can overload and for example lowercase URLs with

Any preferences?

Jul 2, 2010 at 4:48 PM

Those all sound like viable solutions and I'd be more that happy with any of them :)

- In my case, I'm trying to rid my site of all capitalized URLs, so if option 2 would affect all of the html helpers, it would be the most appealing to me.
- Option 1 is more granular, but there are already quite a few overloads. Although, I suppose it could be the last (lowest priority) overload.
- The SiteMapNodeUrlResolver sounds interesting, but I would only encourage you to do it if more requests to manipulate URLs come in (I wouldn't want to add complexity for something this trivial).

Cheers and thanks again,

-Derek

Coordinator
Jul 20, 2010 at 8:02 AM

It would be the cleanest solution to implement a SiteMapNodeUrlResolver extensibility point IMHO. This class will then be responsible for generating the sitemap node's URL and can be easily overridden.

Coordinator
Jul 20, 2010 at 8:02 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.