+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Unable to navigate to programmatically added urls ("Allow multiple URLs for this page")

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

3 posts, 0 answered
  1. Joakim
    Joakim avatar
    2 posts
    Registered:
    11 Apr 2013
    09 Aug 2013
    Link to this post
    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?
  2. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    Registered:
    18 Jul 2012
    09 Aug 2013 in reply to Joakim
    Link to this post
    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
  3. Joakim
    Joakim avatar
    2 posts
    Registered:
    11 Apr 2013
    21 Aug 2013 in reply to SelAromDotNet
    Link to this post
    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.
3 posts, 0 answered