What's the equivalent of views_get_view in Views 2.0??

Comments

RoboPhred’s picture

I have not had any experience with 1.0 Views, but are you looking for: views_get_current_view();

See issue #249934: Get view arg data from header.

merlinofchaos’s picture

Status: Active » Fixed

It is still views_get_view().

dennison’s picture

Thank you merlin. I figured that much, but what are the parameters? I could not find any info in the API :(

dennison’s picture

Title: vews_get_view in Views 2.0???? » vews_build_view in Views 2.0????

Sorry! I meant views_build_view!!!

dennison’s picture

Status: Fixed » Active

Resetting status to active. Help :(

RoboPhred’s picture

Again, knowing nothing of Views 1, I am assuming that views_build_view would create the needed output to display a view on a page.

In that case, here is an example taken from #259034: Passing number of items to display per page as arguments and tweaked.

  $v = views_get_view('viewname');
  $v->init_display('default');
  echo $v->execute_display();
merlinofchaos’s picture

Title: vews_build_view in Views 2.0???? » vews_build_view in Views 2.0?
Status: Active » Fixed

1) Please, there is no need for the extra ! and ?s -- it reads like you're panicked or something, and if you're panicked while working with a beta whose API has changed a lot, you're in the wrong line of work.

2) See here: http://groups.drupal.org/node/10129

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.