Grouping images by category

Posted by Community Admin on 03-Aug-2018 00:50

Grouping images by category

All Replies

Posted by Community Admin on 05-Jul-2011 00:00

Hi I'm working on a template for the Image Gallery.  I want it to be similar to the Photos & Floor Plans here www.canadream.com/rvRentals.aspx 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

Posted by Community Admin on 05-Jul-2011 00:00

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

Posted by Community Admin on 05-Jul-2011 00:00

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

Posted by Community Admin on 06-Jul-2011 00:00

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

Posted by Community Admin on 06-Jul-2011 00:00

Thanks Ivan!

This thread is closed