Adding Front-End Filter to Image Gallery

Posted by Community Admin on 04-Aug-2018 20:49

Adding Front-End Filter to Image Gallery

All Replies

Posted by Community Admin on 09-Jan-2015 00:00

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.

Posted by Community Admin on 14-Jan-2015 00:00

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?

Posted by Community Admin on 05-Feb-2015 00:00

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

 
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
 

This thread is closed