Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
For various reasons, I need to save the URL-Slug for a new node, as the node is being saved, in a separate area, and need to ensure the same rules are applied for sanitizing it, so that it exactly matches the URL-Slug generated by Umbraco when saving the node.
I assume there is a callable API function to process the node-name to a URL-Slug - i.e. the Umbraco 'Slugify' utility - but finding it is another story.
There is an Extension method called ToUrlSegment()
In the Umbraco.Core namespace
So if you have the string representation of the name of the node that you are creating, the url slug should be just the result of calling ToUrlSegment() on it
Excellent - exactly what I needed.
I read the code, and it has it's own way of handling UTF8 - finding definitive rules on this and diacritic handling is a real can of worms - but so long as I'm doing it the 'Umbraco' way, that's all that matters to me.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted