How to show a view each 5 rows in another view I'd like to create a complex view which combines several views.
I'm using Views Infinite Scroll

The view logic:

view A row-1
view A row-2
view A row-3
view A row-4
view B Block 1
view A row-5
view A row-6
view A row-7
view A row-8
view B Block 2

The difference between view B Block 1 and view B Block 2 is that Block 2 has offset from view B Block 1

Ok the adequate minimum is to insert view B Block 1 to each n row of the view A.

I tried to insert block in the view template but vainly.

Please help!
this can be done by overriding your View's template for the Style Output plugin (e.g. views-view-unformatted--yourview_machine_name.tpl.php). Then in that template outputting something like this:

&lt;?php if (!empty($title)): ?&gt;
  &lt;h3&gt;&lt;?php print $title; ?&gt;&lt;/h3&gt;
&lt;?php endif; ?&gt;
&lt;?php foreach ($rows as $id =&gt; $row): ?&gt;
  &lt;div&lt;?php if ($classes_array[$id]) { print ' class="' . $classes_array[$id] .'"';  } ?&gt;&gt;
    &lt;?php print $row; ?&gt;
    &lt;?php
      // this tells the view to do something after every 4 rows
      if (($id % 4) == 0):
      print views_embed_view('view_machine_name', 'block_1');
      } ?&gt;
  &lt;/div&gt;
&lt;?php endforeach; ?&gt;


If you wanted to alternate your secondary View's blocks - you could add some logic for that too.