I had some problems embedding some views display plugins with viewfield. This specially affected views_accordion, which didn't work at all with viewfield. I found that the outputcall made by viewfield on line 123 to 130 in viewfield.theme.inc
if (!empty($view)) {
$view->set_display($display);
$view->set_arguments($view_args);
if ($view->access(array($display), $user)) {
$view->execute_display();
$output .= $view->render();
}
}
could be replaced with a single
$output .= $view->preview($display, $view_args);
Then everything works as expected.
Comments
Comment #1
mnlund commentedActually I think the right way to embed the view is to use views_embed_view(). This is derived from the following discussion: http://drupal.org/node/246742
Comment #2
darren ohPatch attached. Due to other problems, I am not yet able to test it.
Comment #3
darren ohForgot to attach the patch. The patch should solve issue 373373, so I'm adding the patch there and marking this as a duplicate.