+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Adding Front-End Filter to Image Gallery

Adding Front-End Filter to Image Gallery

3 posts, 0 answered
  1. Chris
    Chris avatar
    11 posts
    Registered:
    16 Sep 2014
    09 Jan 2015
    Link to this post

    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.

  2. Chris
    Chris avatar
    11 posts
    Registered:
    16 Sep 2014
    14 Jan 2015
    Link to this post
    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?
  3. Sabrie Nedzhip
    Sabrie Nedzhip avatar
    534 posts
    Registered:
    02 Dec 2016
    05 Feb 2015
    Link to this post
    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
     
3 posts, 0 answered