4

I have a view that uses a contextual filters of type

Content: Has taxonomy term ID (with depth)

The page display has the following path /objects/%
If I access the site through http://mysite.com/objects/all the view gets triggered and all my objects are listed, http://mysite.com/objects/silver also works fine (now only objects tagged with silver are listed), but if I use http://mysite.com/objects then I get a "Page not found" message, how can I solve this? I wan't the /objects and /objects/all to show exactly the same content.
Of course I could copy the display and add a path for /objects but that don't seem quite right.

1
  • As I just discovered from another answered question (stackoverflow.com/questions/8869512/…), the solution is not to specify a path argument as that would make it required and also set an expected path as is mentioned by Letharion. In other words, just set the path as "objects".
    – user45200
    Commented Mar 12, 2015 at 23:53

2 Answers 2

9
+50

This is an unfortunate side effect of how the menu system works. When the paramter "%" isn't available, you match against a different path, and the View won't get called.

I suggest making /objects an alias to /objects/all, I believe this will then interact properly with the menu-system. If that's not the case, you can force the issue with Path redirect which will redirect the user with an HTTP-response code, and thus land the user at /objects/all.

I minor drawback of using Path redirect is that the redirect logically belongs together with the View, but is now configured somewhere completely different. For that reason, I would prefer to accomplish the redirect and View rendering with Page manager, which will allow you to group the HTTP-response and a Panel together in a more logical manner.

1
  • Thank you. Creating an alias like "objects" for "objects/all" solved the problem. Commented Feb 11, 2012 at 15:08
0

When you configure the contextual menu there are a set of options under When the filter value is NOT in the URL. Select Provide a default value and type all

3
  • 2
    Already tried that without success, it seems like the view isn't loaded at all when i goto /objects/ Commented Nov 25, 2011 at 6:47
  • Will it work when you try /objects/all then ?
    – LLub
    Commented Dec 22, 2011 at 22:23
  • Yes, it does, just seems like it won't supply the default arguments if they are missing. Commented Dec 22, 2011 at 22:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.