Adding dynamic filter in module_invoke() I have created a node named "weekday," and one named "place" on Drupal 7. Next, I created a block view of the fields in "weekday" I wanted to show in the "place" node template.

I implemented it using the following code:

$weekday = module_invoke('views', 'block_view', 'weekday-block');
print render($weekday);


Now I would love to add a flexible filter that allows to load the block module with a extra filter of the different weekdays. Weekdays are a taxonomy term field in the node type "weekday".
The reason is that I would like to request the block by jquery in a link like http://www.example.com/place#Monday.
You want to use views_embed_view(), rather than module_invoke(), for this so you can pass the 'weekday' term as an argument to the view, such as in the following code:

print views_embed_view($view_name, $display_id, $argument); 


There might be an easier way to do this in Drupal 7/Views by using contextual filters directly from the view itself; I'm not sure how you are planning on using jQuery to load each of these new blocks. Are you doing a load operation with the URL on each one? Is there any reason you need to use the # anchor attribute rather than a URL argument like http://www.example.com/place/Monday?

That could make it easier to set this up within views.