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

Forums / Developing with Sitefinity / Getting home page programmatically

Getting home page programmatically

4 posts, 1 answered
  1. Andree
    Andree avatar
    44 posts
    Registered:
    11 Jan 2010
    12 Jan 2010
    Link to this post
    Hi all,

    I've seen a few postings making reference to the SetHomePage() method on CmsManager, but I can't find anywhere in the documentation or classes themselves a way to figure out what the current Home Page is, programmatically.

    Is this possible?


    Regards,
    Alvaro
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    12 Jan 2010
    Link to this post
    Hi Alvaro,

    The line below will return your website home page

    UrlHelper.HomePageInfo homepage = UrlHelper.HomePage;

    Regards,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
    Answered
  3. Andree
    Andree avatar
    44 posts
    Registered:
    11 Jan 2010
    12 Jan 2010
    Link to this post
    Great, thanks Ivan.

    Would it make sense in future releases to implement a GetHomePage() method in the CmsManager? It would pair up nicely with the current SetHomePage() one..

    Regards,
    Alvaro
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    12 Jan 2010
    Link to this post
    Hello Alvaro,

    We will not change this for 3.x versions. We will consider the most appropriate place for similar method that will be used in Sitefinity 4.0.

    Greetings,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Register for webinar
4 posts, 1 answered