Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Shada 55 posts 137 karma points
    Sep 28, 2016 @ 06:52
    Shada
    0

    the umbracoUrlName property not have value after publish

    I have the umbracoUrlName property on all pages but not all have value set on them, does this influence with something? Can the umbracoUrlName values be programmatically set for all pages?

    Now I can set this property manually, but I'd like it to put down automatically after the publication.

  • Marc Goodson 2157 posts 14431 karma points MVP 9x c-trib
    Sep 29, 2016 @ 21:39
    Marc Goodson
    0

    Hi Shada

    The urlname portion of the Url in Umbraco will automatically be taken from the name of the particular page in Umbraco.

    So if you create a page called 'About Us', the urlname will be 'about-us' Umbraco will do the job automatically of making this a valid portion for use in the url.

    However in some circumstances you may want to override the default functionality to produce this url name portion, and to do this you add a textbox property with 'umbracoUrlName' as the alias, then whatever you type in here will become the url name portion. soty typing 'aboutus' in here would create the urlname portion as 'aboutus' intead of 'about us'.

    The downside of this is Umbraco isn't doing anything clever to check whether this manual override is valid in a url name, it assumes you know best if you use this approach, so type in lowercase!! don't use special characters.

    Anyway it exists for editors to manually override the urlname, so you don't need to set it on every page programmatically ?

    But if you have a case for this, you can write .net code to subscribe to the publishing event:

    https://our.umbraco.org/Documentation/Getting-Started/Code/Subscribing-To-Events/

    and use the ContentService to set the value of the umbracoUrlName to your custom rules.

Please Sign in or register to post replies

Write your reply to:

Draft