Closed (fixed)
Project:
Views (for Drupal 7)
Version:
7.x-3.0-beta3
Component:
Miscellaneous
Priority:
Minor
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
23 Sep 2010 at 11:37 UTC
Updated:
7 Oct 2013 at 20:53 UTC
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.
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
Comment #1
dawehnerSo configure "Action to take if argument is not present:" to "Display all values"
This is in the argument settings.
Comment #2
harlekinx commentedyeah, 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..
Comment #3
harlekinx commentedtried this before, but it doesn't work..
Comment #4
MC_McMic commentedI 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.
Comment #5
dawehnerSo this is fixed.
Comment #7
SchwebDesign commentedWoow! 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:
Perhaps:
Comment #8
lykyd commentedI 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.