Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By faheemhameed on
Hi folks,
I have the following code that I copied from another forum post.
$myview = views_get_view('archive-block');
$viewarg = "";
//set the view argument $args[0] to your_variable before building the view
$myview_args = array(0 => $viewarg);
$myview_args = array();
print views_build_view('block', $myview, $myview_args, false, 4);
But the above code is throwing the following error:
Call to undefined function views_build_view()
I actually created a archive view that I want to re-use based on the page context. I want to be able to pass parameter to my particular view.
Please help!
Thanks!
Comments
a bit of googling located:
a bit of googling located: http://drupal.org/node/99721#comment-887231
===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz
Thanks! for the info!
Thanks! for the info! Surprised, I was reading the same thread but missed out that particular comment...
np... sometimes you just
np... sometimes you just need a second pair of eyes. ;-)
===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz