How to render all the contents of a view in a custom module? I have created a view with 4 blocks. Rose,lilly,sunflower,jasmine. All the blocks have common fields. Now i want to display all the contents of the view in my custom module.  When I tried the below code, I can access only the first block (ie)Rose. How can i get all the values of a view in my custom module?

$view = views_get_view(myblock_block');     
$view-&gt;set_display('Rose'); // page_1 or block_1 ... block_n, ...page_n
$view-&gt;set_items_per_page(0);
$view-&gt;execute();
$result = $view-&gt;result;
I've always used views_embed_view to do this. The first parameter is the machine name of your view, the second is the display id. Example:

$view_rose_output = views_embed_view('myblock_block', 'rose');
$view_lily_output = views_embed_view('myblock_block', 'lily').


If your view takes any arguments you can pass that in to the views_embed_view after the first two arguments.

Note that views_embed_view returns the rendered html of the view. If this is what you want, great! Otherwise, I've used the views_post_render hook to alter the output. The function header looks like this:

HOOK_views_post_render(&amp;$view, &amp;$output, &amp;$cache)

where $output is the rendered html, and $view gives you the view object.