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.
I want to print a couple of views on one page. I'm using this
$view1 = views_get_view('article_queue_large/1');
//output the view
print views_build_view('embed', $view1);
My view has url value of article_queue_large and takes a queue id as an argument.
I can view different nodequeues thanks to the argument, but I don't know how to pass the argument into the embeded view.
Can an embed view take arguments?
Comments
Comment #1
jmlavarenne CreditAttribution: jmlavarenne commentedSilly me - I was using the page view url instead of the view name as the function argument... case closed!
Comment #2
jmlavarenne CreditAttribution: jmlavarenne commentedFinaly while I solved one issue, it seems I do have a problem passing arguments to embeded views.
I can pass the argument '1' like this:
I can pass the argument '2' like this:
But if I try to pass the argument '17' like this:
The view reacts as if I had passed the argument '1'.
Does this parameter only take into consideration the first character of the argument?
Comment #3
merlinofchaos CreditAttribution: merlinofchaos commentedarguments should be an array()
Comment #4
jmlavarenne CreditAttribution: jmlavarenne commentedGot it! Thanks.
In case someone else searches for this late at night :
Comment #5
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.