I have a view with 2 contextual filters, each is set to display all results if not present. This is tested on the Views edit screen using the Preview Contextual Filters. Both contextual filters filter taxonomy term Ids.
With none set it gives loads of results; with '152' it returns three results; with '152/366' it returns one result. These are the expected results.
However in my Drupal 7 code I have tried the following, but none of the ones with filters work:
print views_embed_view('my_view','default'); // ✔ all shown
print views_embed_view('my_view','default',152); // ✘ nothing
print views_embed_view('my_view','default','152'); // ✘ nothing
print views_embed_view('my_view','default',array(152)); // ✘ nothing
print views_embed_view('my_view','default',array('152')); // ✘ nothing
print views_embed_view('my_view','default',152,366); // ✘ nothing
print views_embed_view('my_view','default','152','366'); // ✘ nothing
print views_embed_view('my_view','default',array(152,366)); // ✘ nothing
print views_embed_view('my_view','default',array('152','366')); // ✘ nothing
print views_embed_view('my_view','default','152/366'); // ✘ nothing
Also, all the ones that use array
for the contextual filter argument generate an error: "html_entity_decode() expects parameter 1 to be string, array given"
I feel like I'm missing something obvious here...
/
, so152/366
works, as does152
for the single argument case. As I understand itviews_embed_view
takes separate arguments (as you point out), rather than a string combination that needs parsing.