By Chris Gillis on
Hi, I am wondering if it is possible to display a view underneath an exising node. E.g. on each "client" page, have a description of the client, and below that, a view of all "job" nodes that relate to that client.
Hi, I am wondering if it is possible to display a view underneath an exising node. E.g. on each "client" page, have a description of the client, and below that, a view of all "job" nodes that relate to that client.
Comments
I use this php to insert a view
$output = views_build_view('embed', views_get_view('name_of_my_view'), $view_args, true, $limit);Could you expound on
Could you expound on this...?
What do you put in there for $view_args? I would like to have an embedded view show up on similar pages, but with a filter set to show different records, based on the value of a given field. Can this be done?
Thanks,
-eric
I found this page:
I found this page: http://drupal.org/node/47417
My code goes like this:
The following page describes what the variables passed to the function mean:
http://drupal.org/node/70145
and this page gives a good overview of arguments:
http://drupal.org/node/54455
fatal error when trying to print view in a node
I tried to use the code above and I get this error:
Fatal error: Only variables can be passed by reference in /home/httpd/vhosts/....../includes/common.inc(1175) : eval()'d code on line 5
I did look around in some other posts but did not find a solution.
Thanks for any hint,
André
Try separating the function calls
I got that error and solved it by moving views_get_view() out of view_build_view().
That may not be the case everytime, a few of my tries had syntax issues.
this worked / 1 correction
great, this worked! Thanks.
Just 1 correction: The parameters $view_aux and $view_args in the views_build_view statement are corrected like this:
Thanks!
This is great.
How would I change this to not include the most recent article (as in the first story in a descending list)?