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

Forums / Developing with Sitefinity / Find home page using Sitefinity API

Find home page using Sitefinity API

3 posts, 1 answered
  1. Maciej Skiba
    Maciej Skiba avatar
    15 posts
    Registered:
    28 Sep 2009
    02 Aug 2010
    Link to this post
    Hello,

    I am currently working on a custom breadcrumb control for sitefinity and I need to get access to the site's home page (to get its URL, Title etc.). Unfortunately I haven't found any method to do this in Sitefinity API. Is there any method to find site's home page using API? I would be very grateful for any help in this issue.

    Regards,
    Maciej.
  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    03 Aug 2010
    Link to this post
    Hello Maciej Skiba,

    Thank you for using our services.

    Could you please try something as in the bellow code snippet:
    CmsManager cmsManager = new CmsManager();
    Telerik.Cms.Web.UrlHelper.HomePageInfo homePage = UrlHelper.HomePage;
    ICmsPage page = (ICmsPage)cmsManager.GetPage(homePage.ID);


    Sincerely yours,
    Radoslav Georgiev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
    Answered
  3. Maciej Skiba
    Maciej Skiba avatar
    15 posts
    Registered:
    28 Sep 2009
    03 Aug 2010
    Link to this post
    Hi Radoslav,

    Your code works well, thank you. Although I am surprised that CmsManager class doesn't have a property to get the reference to "home page" or that ICmsPage interface doesn't have property that indicates whether page is set as "home page". This approach would be much more "developer friendly" :)

    Regards,
    Maciej.
Register for webinar
3 posts, 1 answered