For some reason, I cannot get the following code to work (even though it appears there are hundreds of examples where this code works for everyone else). This is in the body section in contemplate:
<?
$view = views_get_view('Requirements');
print views_build_view('embed', $view);
?>
As soon as I add that code to my contemplate, any visit to a page that is using that contemplate returns absolutely nothing. Literally, a view source shows no HTML. Furthermore, if I go into the contemplate admin and try to edit the settings for that content type, I also get a page with nothing (once again, no HTML whatsoever). I can insert other PHP commands etc. into contemplate with no issues but for some reason, it hates views_build_view() on my site. Any thoughts? I've looked in my logs and there are no errors.
Thanks.
Comments
Comment #1
jrglasgow commentedif you are getting nothing: White Screen Of Death (WSOD) it means there is a problem with your php code, take a look at your php error log.
Comment #2
Anonymous (not verified) commentedA thought. What would happen if the view was calling the content type the template was being created for, endless loop ?
Comment #3
thekevinday commentedOops, I was looking at the wrong Views version documentation and the wrong views version for this report.
please ignore this, I removed my irrelevant commentary.
Comment #4
Anonymous (not verified) commentedTake a look at http://drupal.org/node/99721#comment-895939 and http://groups.drupal.org/node/10129