I am trying to query blog posts using CRUD, I have managed to get the basic search done.
The problem that I am facing is that I have multiple service providers for my blogs (I have a custom service provider from here). When I ask for my blogs I only get blogs from the default provider, but I only want blogs from from the custom provider.
BlogsManager blogsManager = BlogsManager.GetManager();
List<BlogPost> blogPosblogsManagert = blogsManager.GetBlogPosts().Where(b => b.Status == ContentLifecycleStatus.Live).ToList();
I am able to find the provider(s)
inside the blog manager, but I don't understand how to set it.
(blogsManager.Provider / blogsManager.AllProviders)
For anybody who is looking. I managed to solve this.
var providers = BlogsManager.GetManager().GetContextProviders();
var blogs =
blogManager = BlogsManager.GetManager(provider.Name);
var tempList = blogManager.GetItems(
.Empty, 0, 0)
.Where(i => i.Status == ContentLifecycleStatus.Live && i.Visible ==