Join us this Friday for AI in Action at the Virtual Happy Hour! This free virtual event is open to all—enroll now on Academy and don’t miss out.
Join us this Friday for AI in Action at the Virtual Happy Hour! This free virtual event is open to all—enroll now on Academy and don’t miss out.
got reolved from my self, here is the coding
var pages = FindBlogPages(root, "BloggerProfile", modelPage.Property["BloggerProfile"].ToString());
public static IEnumerable<PageData> FindBlogPages(PageReference listRoot, string property, string propertyValue)
{
IEnumerable<PageData> pages;
var criterias = new PropertyCriteriaCollection
{
new PropertyCriteria()
{
Name = property,
Type = PropertyDataType.PageReference,
Condition = CompareCondition.Equal,
Value = propertyValue
}
};
var repository = ServiceLocator.Current.GetInstance<IPageCriteriaQueryService>();
pages = repository.FindPagesWithCriteria(listRoot, criterias);
return pages.Take(4);
}
Hi, Sandeep,
Do note that FindPagesWithCriteria should be used with care, if possible, use ContentLoader instead or cache it. It comes with performance cost.
If all blogs have a common root, the pseudo code would be:
var pages = _contentLoader.GetChildren<BlogPage>().Where(p => p.BloggerProfile == propertyValue).Take(4).ToList();
BR,
Marija
Hi All,
I have a contact page for saving authors in my site.
I have a blog page for writing blog posts.
so when i open a blog page i want to display related blog posts of perticular author.
so how can i achive this.