Need fluent API queries

Posted by Community Admin on 05-Aug-2018 23:00

Need fluent API queries

All Replies

Posted by Community Admin on 04-Mar-2011 00:00

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

Posted by Community Admin on 07-Mar-2011 00:00

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!

Posted by Community Admin on 07-Mar-2011 00:00

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

Posted by Community Admin on 07-Mar-2011 00:00

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!

Posted by Community Admin on 14-Apr-2011 00:00

Ivan-

Did the API change?

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

Visual Studio doesn't recognize the "ToList" method. 

Posted by Community Admin on 14-Apr-2011 00:00

".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.

This thread is closed