More in this section

Forums / General Discussions / Grouping images by category

Grouping images by category

5 posts, 1 answered
  1. Devin
    Devin avatar
    149 posts
    Registered:
    09 Jun 2009
    05 Jul 2011
    Link to this post
    Hi I'm working on a template for the Image Gallery.  I want it to be similar to the Photos & Floor Plans here http://www.canadream.com/rvRentals.aspx?id=120.  I'm putting the photos in an album for each page and each album contains two categories.  I'd like to group the thumbnails by category.  Can this be achieved by modifying the default Image and strip of thumbnails template?

    Thanks,
    Devin
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    05 Jul 2011
    Link to this post
    Hello Devin,

    ImageGallery allows you to show items grouped by category as a static setting from the controls designer. When you open the control for editing there is a section "Narrow selection" >> "Selection of Images". The problem here is that this does not allow you to set the category dynamically. There is a way to do this by creating some logic that appends the category name in the url which will force the Image gallery to filter its data source.

    You need to format the URL of the category so that it is

    /-in-Category/Categories/  and after that goes the cateogry name

    example
    /-in-Category/Categories/rootcategory
    /-in-Category/Categories/rootcategory/child1
    /-in-Category/Categories/rootcategory/child1/nestedchild



    Best wishes,
    Ivan Dimitrov
    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items
  3. Devin
    Devin avatar
    149 posts
    Registered:
    09 Jun 2009
    05 Jul 2011
    Link to this post
    Hi Ivan,
    What I'd like to do is have two image containers on the same page and filter the results programmatically.  For example:

    ItemsList1.FilterExpressions.BuildExpression().EqualTo("Category", "Category A").Build();
    ItemsList2.FilterExpressions.BuildExpression().EqualTo("Category", "Category B").Build();

    Can I do this by modifying the template or will I have to create my own control?

    Thanks!
    Devin
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    06 Jul 2011
    Link to this post
    Hello Devin,

    You need a custom control to do this. In the template you won't be able to execute this code.

    Best wishes,
    Ivan Dimitrov
    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items
    Answered
  5. Devin
    Devin avatar
    149 posts
    Registered:
    09 Jun 2009
    06 Jul 2011
    Link to this post
    Thanks Ivan!
5 posts, 1 answered