Print a view within another view Here is my situation,


I have a view-1 which will list the node titles based on Content: Taxonomy term CONTEXTUAL FILTERS
View-2 which will list all the taxonomy terms (of a vocabulary) with node count.


Now how do I print the view-1 as a custom field within view-2.

The reason I am trying to do this is, I am trying to construct a UI which will display the nodes on click on taxonomy terms with count.

I tried using below code to print view-1 as a custom PHP field on view-2, but it did not work for me.

    print views_embed_view('view-1','block_1', $row-&gt;tid);


$row->tid is the term ID argument I am trying to pass
The module Views Field View may work for you. It's worth to try.


  This module allows you to embed a view as a field in a view. A new
  field handler is made available, so this can also be used in area
  (header/footer/empty) handlers as well as rows.
  
  This view handler can accept arguments from fields of the parent view
  using tokens and pass them into the child view for each row. Raw or
  rendered token values can be used, as well as static values.


OR

You can even create two displays in a view - one is Page and the other is Attachment.
For your case, view-2 would be Page and view-1 would be Attachment.  

You can select various settings in the attachment view such as Attach to, Contextual filter, etc.




Check this answer about an attachment view. I had a book Drupal 6 Attachment Views, but could not find a book for D7.