Passing an Argument from the URL to view block's picture

I am not sure if this is an appropriate discussion topic to post here. If not, my apologies. I saw how others had posted views arguments solutions here and thought if I could get this resolved, it would make a nice addition to the dojo.

I just created a forum help request on D.O at and was wondering if anyone was familiar with the challenge of passing a URL argument to a view block.

I look forward to any advice you can share.



This has been resolved. See's picture

This has been resolved. See for resolution.

I am going to write this up and share, just not right now. Gotta get back on schedule. The key points are:

  1. Remember to distinguish between the URL and the alias URL
  2. Remember to set views argument to the type of variable you are passing (I had tax:term versus tax:ID set for the argument - dah)


Cindy McCourt
703-803-4621 home office
703-927-5636 cell

passing argument to view block get 404

shv_rk's picture


I have the same problem please help me...
druapal 6, IIS6, no clean urls

here is my situation:
basically, i want to create a normal page but at the bottom it should list all my ingredients.
next to my list I want to have a links as: A-e E-F and so on to filter my list when the user clicks on it.
here is what i have done:
I have created a content type: ingredients
I have created a taxonomy vocabulary with A-e E-F ... terms
I have created a views to list all my gradients
i have created the my view as a block
set the view argument as:
taxonomy: term
Action to take if argument is not present: > phpcode:
$path = drupal_get_path_alias( $_GET["q"]);
$path = explode("/", $path);
return $path[1];

Action to take if argument does not validate: Display All Values

when I click on my A-e link for example with this url: index.php?q=ingredients/A-E
i get 404 page

if I return "A-E" works fine...

also it works perfectly if i create the view as a page... but i need it as a block anyway
am I missing something? please help me...


Drupal Dojo

Group organizers

Group events

Add to calendar

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week