Hello,

I am somewhat of a Drupal/Views Noob, so I apologize in advance for not using the correct terminology when asking for help with this.

Basically, I'm attempting to create a block view that has:

Style: Grid 5 Collumns, 1 Row
Items to Display: 5
Fields: Image linked to node, Taxonomy term linked to taxonomy page
Sort: Random
Filters: Node: Type = Product AND Content:image - list = TRUE AND Taxonomy or Product 1 or Product 2 or Product 3 or Product 4 or Product 5

Basically my intent is to have 5 Products side by side in one row which works great. However, I also would like to limit it to one product per taxonomy term. That way, it will always show all 5 taxonomy terms, but a random product. Instead it displays a random of all taxonomy terms which could equal multiple products of the same taxonomy term showing up in the block.

I have spent a lot of time searching for a fix; however, I haven't found any solution. Any help would be much appreciated. Thank you. Thank you as well for creating such a robust module that has met many of my needs so far without knowing any PHP.

Comments

merlinofchaos’s picture

Status: Active » Closed (won't fix)

You can't create a view that does just one X per Y. That's not something that can be done with SQL very easily.

northwestautoparts’s picture

Ok, no problem. With my limited knowledge of SQL; I wasn't sure how involved this would be. Thanks again.

merlinofchaos’s picture

The 'easiest' solution is to use two views, and embed one in the other. First bring up a list of Y, and then in the theme, use the value for Y to call on a view that brings up 1 X for that Y with the right criteria.

There probably ought to be a style that lets people do this more easily.