Fluent API get page content
Hello,
I want to get the content of a frond end page with the Fluent API but I don't
see a property content or something like that. Question How do I get the content
and widgets through the API?
Greetings,
Jens
Hello Jens,
Thank you for contacting us.
Here is a link to our Sitefinity documentation on Querying pages with Native and Fluent API:
http://www.sitefinity.com/documentation/documentationarticles/developers-guide/sitefinity-essentials/pages/querying-pages
We have provided samples for Finding a page data by node ID, Finding a page data by title, Finding a page data by URL of the node. All of these method return PageData object. You can access all widgets on a page by retrieving Controls property of PageData object.
To retrieve and work with frontend pages only, in the given documentation examples you should use LocatedIn facade:
public
PageData FindPageByTitleFluentAPI(
string
pageTitle)
PageData pageData =
null
;
var count = 0;
App.WorkWith().Pages().LocatedIn(Telerik.Sitefinity.Fluent.Pages.PageLocation.Frontend).Where(pN => (pN.Page !=
null
&& pN.Page.Title == pageTitle)).Count(
out
count);
if
(count != 0)
pageData = App.WorkWith().Pages().LocatedIn(Telerik.Sitefinity.Fluent.Pages.PageLocation.Frontend).Where(pN => (pN.Page !=
null
&& pN.Page.Title == pageTitle)).Get().First().Page;
return
pageData;