How to change URL names in Umbraco

This is my first time using Umbraco, and I created document / page types using the wrong naming format, and now it happened in my page url like /about-page/ . How I would like to change them to /about , since I was looking for the admin control panel, and there is still no way to change their link to document values.

Can anyone provide a simple code-based example using umbracoUrlAlias ​​or umbracoUrlName, as I could change this, preferably in Razor.

thanks

+7
umbraco umbraco7
source share
5 answers

Editing @run yards digbyswift help solution in comments

The right decision:

  • Create a Property in Document Types that applies to all pages that you want to change URL
  • Call up the name of anything, such as the URL of a page, and possibly add a new tab.
  • Call alias umbracoUrlName
  • Enter text
  • Must Not Required (As when replacing .Url with .umbracoUrlAlias it must be present in the views)
  • General tab
  • Click Save on the top right of the page.

Added screenshot for starter kit on Umbraco v7.2.5 Adding a screenshot for the starter kit on Umbraco v7.2.5

+18
source share

If I don’t really misunderstand your problem, you should just change the name of your page and publish it. This does not require an additional field, just change the value on the "Properties" tab and publish the page. This will automatically change the page URL.

+3
source share

You can also create a property called umbracoUrlName using the TextString property TextString . If this value matters, it will generate a fragment of the page URL using that value, not the page name. This changes the page URL, rather than creating an alias, such as umbracoUrlAlias .

+2
source share

Decision:

  • Create a property in the Document Types section that applies to all pages that you want to change the URL
  • Call up the name of anything, such as the URL of a page, and possibly add a new tab.
  • Call alias umbracoUrlAlias
  • Enter text
  • Make this mandatory (as when replacing .Url with .umbracoUrlAlias in the views it must be present)
  • Go to all your pages and rename them using the property you just created.
  • Now with your code, say the navigation in which you used .Url , change it to .umbracoUrlAlias , and the new URL will be used.

Please note that if you do not use .umbracoUrlAlias , the links will still be active, that is, they will work, but they will not appear in the address bar, since .Url spits out the originals associated with the page.

0
source share

You can apply to urls in web.config:

In the find section:

 <add key="umbracoUseDirectoryUrls" value="false" /> 

this will set the url names for the newly created name.aspx elements

If you set it to true, then the new items will be named as / name /

Say you might want to avoid using some UMPraco pipline URLs, just use this parameter - add the URLs you need to bypass:

 <add key="umbracoReservedUrls" value="~/config/splashes/booting.aspx,~/install/default.aspx,~/config/splashes/noNodes.aspx,~/VSEnterpriseHelper.axd" /> 
0
source share

All Articles