Closed (fixed)
Project:
Views (for Drupal 7)
Version:
6.x-2.6
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
6 Sep 2009 at 19:08 UTC
Updated:
28 Nov 2012 at 15:04 UTC
Hello,
I have embedded a views with the function views_embed_view. This view accept two arguments, that are a taxonomy Id and a cck text field with the content "ok".
So results are filtered by taxonomy id and if this cck field is filled or not.
I embed my view with
$argom =array("all" , "ok );
print views_embed_view("articolo_principale", "default", $argom ); ?>
but I can't get any result. If I pass only the first argument, in this way
print views_embed_view("articolo_principale", "default", "7"); ?>
it filters correctly.
So , I don't understand if the argument is passed right or not.
How can I see if the view "receive" the argument? Am I making mistakes with code?
Thanks,
Fabio
Comments
Comment #1
dawehnerThis is not valid php, but anyway.
It should work. Did you tryed out in the preview, whether the two arguments works?
Comment #2
alexic commentedWell, if the problem was the " after ok, it was only a copy-problem.
Anyway, I tried in preview and it works. For default view, i pass all/ok or 31/ok and it works! But in my code it does not.
Comment #3
alexic commentedIssue seems solved by passing multiple arguments in this way:
Comment #5
2dareis2do commentedI have a view that has support for multiple arguments and one argument has multiple arguments
therefore I am trying to pass something like this
using
I can currently use the view through the ui using something like this
23996+79703+77617+88730+109201+90355+87751+87731+97593/0/3933/2
as an argument to display the results I want. How do I pass this using views_embed_view ?
Comment #6
2dareis2do commentedsomething like this worked for me:
echo views_embed_view($view_name, $display_id_ref, $first_arg, $second_arg, $third_arg, $fourth_arg
First argument is input as a string i.e. $first_arg,$second_arg,$third_arg,$fourth_arg
$first_arg = "23996+79703+77617+88730+109201+90355+87751+87731+97573+87001";
or
$first_arg = "23996,79703,77617,88730,109201,90355,87751,87731,97573,87001";