Unable to navigate to programmatically added urls ("All

Posted by Community Admin on 04-Aug-2018 09:04

Unable to navigate to programmatically added urls ("Allow multiple URLs for this page")

All Replies

Posted by Community Admin on 09-Aug-2013 00:00

When I add urls to a pagenode programmatically (the ones listed for "Allow multiple URLs for this page") they are not navigable until I open the page look at "Title & Properties" page and click Save changes. I've tried turning off cache but it doesn't help, trying to refresh it doesn't help either so I'm guessing I have to refresh something to do with the routing?

Posted by Community Admin on 09-Aug-2013 00:00

I believe when you create additional pages using the API you must also call RecompileUrls on the PageManager to commit those to the page node.

I hope this is helpful; let me know if that doesn't solve the issue

Posted by Community Admin on 21-Aug-2013 00:00

Been a while since I could try this. Anyhow, I've now tried this and it didn't work I'm afraid.

page.NavigationNode.Urls.Add(new PageUrlData Id = Guid.NewGuid(), Url = url );
pageManager.RecompileItemUrls(page.NavigationNode);
pageManager.SaveChanges();

where "page" is of type "PageData"

Not sure if this will be of any help but this is basically what I'm trying to do. how ever the page is never able to navigate to the urls I'm creating even if I do this recompiling.

This thread is closed