Adding Front-End Filter to Image Gallery
I found this Sitefinity blog entry on adding a front-end filter to the news widget and was hoping to apply something similar to the image gallery. I've added a drop-down list to the Simple List template, and like in the blog, the list is populated in the IntializeControl method with the categories pulled from a custom classification:
protected
override
void
InitializeControls(Telerik.Sitefinity.Web.UI.GenericContainer container, Telerik.Sitefinity.Web.UI.ContentUI.Contracts.IContentViewDefinition definition)
var productColorCategory = TaxonomyManager.GetManager().GetTaxonomies<FlatTaxonomy>().Where(t => t.Name ==
"product-colors"
).Single();
var productColors = productColorCategory.Taxa;
this
.ProductColor.DataTextField =
"Title"
;
this
.ProductColor.DataValueField =
"Id"
;
this
.ProductColor.DataSource = productColors;
this
.ProductColor.DataBind();
this
.ProductColor.Items.Insert(0,
new
ListItem(
"Choose color..."
));
base
.InitializeControls(container, definition);
The problem I'm running into is figuring out how to make the image gallery update. The blog entry made it look simple enough, but then I found out that the image gallery doesn't have the GetItemsList method, or any similar method.
How would I update the query to include the category?
If it helps at all, we're using Sitefinity 7.0.
Okay, so I did try to edit FilterExpressions, but it looks like it gets used in the IntializeControls method, which doesn't do me much good. How could FilterExpressions be implemented so that I might be able to delay the execution to OnLoad? Or is there a way to filter images based on custom classifications by using the Libraries API?
Hello Chris,
It seems that the current forum thread is a duplicate of the following forum thread. I have just posted a reply in the other thread with a suggestion. Can you please try it on your end?
I would also kindly ask you to keep the communication in one thread in order the communication to be more straightforward and structured. Thank you in advance for your kind understanding.
Regards,
Sabrie Nedzhip
Telerik