The fields get populated as expected but the new url does not automatically change unless I manually login to Umbraco itself and click "Save and Publish".
Does anyone have any suggestions please? I really need the Url to automatically apply during this loop, there are too many nodes to manually go and save them all again.
Setting umbracoUrlName programmatically
Hello, I am trying to set the umbracoUrlName for a collection of nodes using the Umbraco Api.
I am pretty much just looping through a bunch of nodes, setting the "umbracoUrlName" field then finally saving and publishing them.
The fields get populated as expected but the new url does not automatically change unless I manually login to Umbraco itself and click "Save and Publish".
Does anyone have any suggestions please? I really need the Url to automatically apply during this loop, there are too many nodes to manually go and save them all again.
You need to just clear your cache and new url should appear in the cache.
You can create a method and call this at the end of your code.
Please try and let me know how it goes for you.
Hello, sorry for the delay in reply to this and thanks for your suggestion.
I tried your method but unfortunately it did not work for me i'm afraid, but I think it was down to how I was debugging and testing my code.
I ended up running the code on our live server/database and everything got published as intended.
My guess is whilst debugging this I was not allowing the system to run any background events that may get triggered after a node save.
is working on a reply...