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

Forums / Sitefinity SDK / Need fluent API queries

Need fluent API queries

6 posts, 1 answered
  1. Duneel
    Duneel avatar
    166 posts
    Registered:
    08 Dec 2010
    04 Mar 2011
    Link to this post
    Hello,

    Can someone please send me the fluent API queries for the following?

    1. To retrieve the list of ALL the pages in the website (Non backend pages).
    2. To retrieve the list of All the Blogs in the website.
    3. To retrieve the list of All the Blog Posts in the website.
    4. To retrieve the list of All the News Items in the website.

    Also how do I find the absolute url for each item (let's say a NewsItem)?

    Thanks,
    Duneel

  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    30 Sep 2016
    07 Mar 2011
    Link to this post
    Hi Duneel,

    1. To retrieve the list of ALL the pages in the website (Non backend pages).

    var pages = App.WorkWith().Pages().LocatedIn(Telerik.Sitefinity.Fluent.Pages.PageLocation.Frontend).Get().ToList();


    2. To retrieve the list of All the Blogs in the website.

    var blogs = App.WorkWith().Blogs().Get().ToList();

    3. To retrieve the list of All the Blog Posts in the website.

     var blogs = App.WorkWith().BlogPosts().Get().ToList();

    4. To retrieve the list of All the News Items in the website.

    var blogs = App.WorkWith().NewsItems().Get().ToList();


    Also how do I find the absolute url for each item (let's say a NewsItem)?


    You should know the page on which news widget is dropped. The url is based on this page and the UrlName of the content item.

    Greetings,
    Ivan Dimitrov
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  3. Duneel
    Duneel avatar
    166 posts
    Registered:
    08 Dec 2010
    07 Mar 2011
    Link to this post
    Hi Ivan,

    Thanks for responding. Just one more thing... How do I find the absolute URL of each page nodes? What is the property i have to read?

    Thanks,
    Duneel
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    30 Sep 2016
    07 Mar 2011
    Link to this post
    Hello Duneel,

    For pages, each PageNode has a property - Urls. In the urls collection of UrlData objects when RedirectToDefault == false this is the default page url.

    Greetings,
    Ivan Dimitrov
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
    Answered
  5. Brett Winklesky
    Brett Winklesky avatar
    6 posts
    Registered:
    10 Dec 2009
    14 Apr 2011
    Link to this post
    Ivan-

    Did the API change?
    var blogs = App.WorkWith().BlogPosts().Get().ToList();

    Visual Studio doesn't recognize the "ToList" method. 
  6. Chris
    Chris avatar
    21 posts
    Registered:
    16 Aug 2010
    14 Apr 2011
    Link to this post
    ".ToList()" is an extension method in the System.Linq namespace.  Be sure you have the "using System.Linq;" line at the top of your page.
6 posts, 1 answered