Hi all,
I have a page that I need to render as PHP code, but I also need to embed a view in that page. Normally I use the Insert View module to embed views into my code, but that approach won't work on a node that is PHP code mode instead of Filtered or full HTML mode. The code to show my view using Insert Views approach would be:
[view:commissioners=block_1]
I'm trying to get the same results as this while in PHP code mode by using the views_build_view method, but have not gotten it to work yet.
To my understanding, I would want to use something like this:
<?php
echo views_build_view('block', views_get_view('commissioners'), null, false, 1); //OUTPUT THE VIEW
?>
When I do this, however, and update the page, the page is blank white when I view it. No theme, no content, nothing.
Is there something obvious that I'm doing wrong here? I've found numerous examples of others using this approach with success, and don't see that I'm doing anything different than they are. Any help is greatly appreciated!
Comments
Try this
that worked great, thanks!
that worked great, thanks!