Closed (fixed)
Project:
Views (for Drupal 7)
Version:
6.x-2.6
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
5 Jul 2009 at 15:15 UTC
Updated:
25 Jul 2009 at 09:44 UTC
I've got a view which uses a couple of exposed filters. I want to call the view using $view = views_get_view - but how do I set the exposed filters using this method?
Comments
Comment #1
merlinofchaos commentedThis one is quite easy. After the views_get_view and before anything else:
Comment #2
jim0203 commentedThanks Earl, that works great.
Is there anything similar that works with views_embed_view()? In other words, how do I set an exposed filter for an embedded view?
Comment #3
dawehnerviews_embed_view is just a wrapper, easy to use helper functions, but if you want to do more, you cannot use it.
See the code of views_embed_view, there you have the full $view object to do what you want to do with it.
I think if it works fine, this could be closed
Comment #4
jim0203 commentedThanks dereine. I worked out a way to do what I wanted to do: I changed the view to accept arguments in place of the data entered into the exposed fields, and it worked great: