Hi,
i think it should be possible to set a default argument if it's missing in the url, but i didn't manage to get things working.
My view has a taxonomy argument. If the argument is missing, the view should simple display all values.
But instead there is only a message like 'the page you are trying to visit doesn't exist'.

My path looks like news/%/hot.

  • news/all/hot - works fine
  • news/blabla/hot - also works as expected
  • news/hot - doesn't work. i want it to behave like news/all/hot

I also tried the Provide Default Value-option but didn't got it working either.

I know it's not that importent and i will use the 'all'-wildcard for the moment. But i want to know if it's possible or not.
Thanks in advance!

Comments

dawehner’s picture

Status: Active » Fixed

So configure "Action to take if argument is not present:" to "Display all values"

This is in the argument settings.

harlekinx’s picture

yeah, this makes sense. but it doesn't work. i have changed the path to news/new/% but if i browse to news/new i only get a page not found-error.
it seems the menu-path isn't created..

harlekinx’s picture

Status: Fixed » Active

tried this before, but it doesn't work..

MC_McMic’s picture

I just resolved my own, similar issue with the help of the #drupal-support IRC folks, and I thought I'd share here on the forums...

I basically have a view that pulls portfolio pieces (nodes) and displays them in a slideshow. It pulls them based on Taxonomy terms (Arguments: Taxonomy: Term). I had my Page display's path set to "portfolio/%". I ran into several issues with this, as my view would not do any of the following:

a) Display all values when the argument is missing
b) Display all values if the argument does not validate
c) Provide a default value

Compounding my frustration was the fact that all of these issues were non-existent in the Preview, but persisted on the site.

I ultimately resolved these issues by eliminating the "%" from my path. I know this may not be useful to those of you using a "%" in the middle of a path, but *if* you can spare it at the end of your path, do so.

dawehner’s picture

Status: Active » Fixed

So this is fixed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

SchwebDesign’s picture

Woow! http://drupal.org/node/920436#comment-3661998 fixed this exact same issue for me as well (Views 3 - D6) , thanks for posting it MC_McMic.

Shouldn't the code be modified to work with the % appended at the end or change the help text when creating a views page path to inform people of this? I was about ready to begin the lengthy process of disabling my other modules one by one to see which could be causing this because i wasn't sure how else to debug this.

e.g. Instead of:

This view will be displayed by visiting this path on your site. You may use "%" in your URL to represent values that will be used for arguments: For example, "node/%/feed".

Perhaps:

This view will be displayed by visiting this path on your site. You may use "%" in your URL to represent values that will be used for arguments: For example, "node/%/feed".  Please note: it is not necessary to use a single % at the end of your path.  For example, "blog-posts/%". 
lykyd’s picture

Version: 6.x-2.11 » 7.x-3.0-beta3

I had the same problem with a path like "test/%/%"
The solution was to clone my view page to create exactly the same with the path "test/%" and removing the second argument of it.
This view is called when I have just the first argument, the other when I have both.