Hi,
We're creating a view for a Product display, We' like for each node to extract the available values of an attribute (colours) from all product variations for that node, so we can list the available colours somewhere on the layout as a list.

We'd like to include this in a view, as a field.

What is the recommendation for this?

Comments

rszrama’s picture

Status: Active » Closed (fixed)

I'm pretty sure I'd just recommend a custom Views field handler. You might be able to rig this up in the View itself through some combination of aggregation / contributed modules, but I doubt it'd be worth the time it took to figure that out. : P

So, custom field handler that looks at the node represented by the current row in the result, loads the referenced products, and extracts the relevant field values. It's a bit brute force, so I'd make sure you were caching the rendered View for at least some amount of time (even 1 minute) to avoid running all those entity loads every page request.