Hi
I am working on a drupal 7 view
I am trying to embed a view in a php field and it's not working.
How can I do that ?
Here is my code:

$view = views_get_view('view-name');
$myarg = array();
$display = $view->execute_display('block', $myargs);
print $display['content'];

Thanks

Comments

hoZt’s picture

Have you tried viewfield? This module should do want you want.

creatile’s picture

I think that viewfield is not stable for Drupal 7 but I adchieved to embed a view in a block with views php

//using views_embed_view
$output = views_embed_view($viewname, $display_id = 'name of my view');
print $output;

Thanks

Liam Morland’s picture

Issue summary: View changes
Status: Active » Fixed

Status: Fixed » Closed (fixed)

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