0

I have a view with a block display. Is there any way to change the block pager page programmatically? Currently i am embedding theview using the views_embed_view and i am passing the url arguments. What i need is to pass also the pager index argument also. Is this possible?

Thanks in advance

1

This is how you can get a view programmatically:

  $view = views_get_view('view_name');
  $view->set_display('view_block_name');
  $view->set_arguments(array($argument_goes_here));
  $view->pre_execute();
  $view->execute();
  print $view->render();

The views object has many functions which can be viewed here.

You can set current page for the pager with $view->set_current_page($page);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.