Get a list with distinct values of a property only from products which have that property
Hi,
I have this situation: some products have a property called "Brand", others don't. And in one page I need to list down all possible brands, so that users can click a brand and get a list of all products with that brand. For that, I have to make a query that takes only the products that have the property "Brand" and get a result set with distinct values of this property. Is it feasible to take this approach for listing brands without affecting too much on performance? Or what would be a good approach for this situation?
Also I thought about making the Brand as a category, but I could end up with too many categories.
I made an xslt extension function where I try to get the list with some LINQ query, but not very successful :). If it can be done from xslt, I would like to know that too, I am just starting to get familiar with the API.
Get a list with distinct values of a property only from products which have that property
Hi,
I have this situation: some products have a property called "Brand", others don't. And in one page I need to list down all possible brands, so that users can click a brand and get a list of all products with that brand. For that, I have to make a query that takes only the products that have the property "Brand" and get a result set with distinct values of this property. Is it feasible to take this approach for listing brands without affecting too much on performance? Or what would be a good approach for this situation?
Also I thought about making the Brand as a category, but I could end up with too many categories.
Hi Andrei,
Are you working through .NET or XSLT for this one?
Hi Søren,
I made an xslt extension function where I try to get the list with some LINQ query, but not very successful :). If it can be done from xslt, I would like to know that too, I am just starting to get familiar with the API.
Take a look at the first question in this article http://www.dpawson.co.uk/xsl/sect2/N2696.html it should do the trick for you.
Let me know if you need some .NET code as well :)
is working on a reply...