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

Forums / Developing with Sitefinity / How to Get Child page urls

How to Get Child page urls

2 posts, 0 answered
  1. Ajay
    Ajay avatar
    46 posts
    Registered:
    14 Nov 2013
    12 Jan 2015
    Link to this post

    Hi ,

    As per my Requirement, if i pass page page id , i need to Show the Childpage urls

    i have reference code but its old version Code .

    Now i'm Using Sitefinity 7.0 , please guide me how to write below code in 7.0 version

    cmsPage cmsPage = (CmsPage)new CmsManager().GetPage((Guid)pageId);
    if (mode == DisplayMode.Page_Body)
        this.doPageMenu(cmsPage.ChildPages, (Guid)pageId);
     
    private void doPageMenu(PageBase.Relation__ChildPages nodes, Guid pageId)
        {
            StringBuilder sb = new StringBuilder();
            Telerik.Cms.CmsManager cmsManager = new Telerik.Cms.CmsManager();
            nodes.Sort("Ordinal", System.ComponentModel.ListSortDirection.Ascending);
            for (int i = 0; i < nodes.Count ; i++)
            {
     
                Telerik.Cms.ICmsPage p = (Telerik.Cms.ICmsPage)nodes[i];
                if (p.PageType != CmsPageType.Group)
                sb.Append("<li><a href=\"" + this.Page.ResolveUrl(p.DefaultUrl.Url) + "\">" + p.MenuName + "</a></li>");
            }
            sb.Append("</ul>");
             
        }

     

    Thanks & Regards

    Ajay reddy

  2. Svetoslav Manchev
    Svetoslav Manchev avatar
    735 posts
    Registered:
    29 Nov 2016
    15 Jan 2015
    Link to this post
    Hi Ajay,

    You can find CRUD operations samples for page in the Pages API documentation on that link.

    Regards,
    Svetoslav Manchev
    Telerik
     
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
2 posts, 0 answered