Q: Howto display referenced entities linked from Megarow table?
(Similar like Commerce Backoffice but without Commerce Backoffice installed)

I have two views, both are pages. One shows a list of nodes (like "Product displays"). The other one shows a list of entities (like "Product variations"). The entities are referenced by an entity reference field in the nodes.
What kind of contextual filter should be used in the view with the entity listing to limit the displayed entities to only the ones referenced by the appropriate node?
When using CONTEXTUAL FILTERS:
(Node referencing products from field_product_reference) Content: Nid
With setting: "When the filter value is NOT available Provide default value Content ID from URL", nothing shows up.

However, when I use the same view with the entity listing as a block on the Product display node page, all the correct entities that are referenced from the node show up.

Besides it not working yet, is there a better way how to have the referenced entities show in a Megarow table of nodes?

Comments

Artusamak’s picture

Status: Active » Fixed

You could call a custom menu entry that gets as an argument the product display and send it programmatically to your view. With the output generated returned as the menu entry markup, you could get your result.

Code example to send arguments to a view:

$array = array('3250+32');
$view = views_get_view('myview');
$view->set_display("myblock");
$view->set_arguments($array);
$view->pre_execute();
$view->execute();
$content = $view->render(); 

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.