Filter blog post
I have the following code to grab the blog posts I want:
links.DataSource = App.WorkWith().BlogPosts().Where(bp => bp.Status == ContentLifecycleStatus.Live
&&
bp.GetValue<
string
>(
"SelectedAuthor"
)
.ToLower()
.Contains(Name.ToLower()))
.Get()
.ToList();
links.DataBind();
Hey Kevin,
I think you should do this with a custom UserControl, as you probably have right now. That would be the easiest way. There is a blog post somewhere on how to change your UserControl so that you can make it editable through the Design -> Widget Templates section. Can't remember it exactly.
One other thing: I don't think it is necessary to call the .ToList() method. The result of this Fluent API call returns an IQueryable which can be bound to the Datasource. A .ToList() will cause an extra call to the database.
Kind regards,
Daniel
Thanks Daniel. I'll try it without the ToList. Now, if I could only find the way to make it editable through the design -> Widget Template section.