Search code examples
drupalargumentsdrupal-viewsdrupal-7drupal-theming

How to pass arguments between views in Drupal-7


I consistently find myself up against the following use case, and have yet to grok the proper workflow / solution:

I would like to display two views.

In the first view, each row displays one node of type-x.

The second view shows nodes of type-y, which are associated with node type-x via a nodereference, as follows:

    View-1   View-2
    ------   ------
row1 X-a <---> Y-a
row2 X-b <---> Y-b
row3 X-c <---> Y-c
row4 etc <---> etc

For example, X is an event, and Y is a venue. Or, X is a porfolio page, and Y is a paged gallery.

I understand that there are other ways of approaching this - for example using node views rather than fields, but I am trying to leverage views to create 2 distinct custom queries related by an argument passed from one view to the other.

This is a variation of a question I asked earlier (Programmatic Views in Drupal 7), and hopefully a clarification.

Any help, even (or especially) just on the semantic level, is greatly appreciated.


Solution

  • You should use the EVA module. It does what you need in an elegant way.

    https://drupal.stackexchange.com/questions/5732/is-there-a-good-tutorial-for-entity-views-attach-module