Grouping images by category
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
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
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();
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
Thanks Ivan!