I have a view with page path set to a users menu local task and no argument set for the view.

user/%/mydashboard

This returns all posts the way I want, with the url correct and without limiting the view by the argument.

user/4/mydashboard

But when I apply an exposed filter, the filter works fine, but the path is returned without the uid

user/%252Fmydashboard?uid_1=&project=255

Is there a way to have the path returned with the uid after filtering? Adding an argument works for the filter, but limits the view as well. Thanks

Comments

merlinofchaos’s picture

Try the Global: Null argument. It doesn't do anything, which is surprisingly the answer for things like this.

mshaver’s picture

Yep that definitely worked! Thanks a bunch! Is it possible to use Global: Null and only display the menu link to the user on their user page then? Is that asking too much??

merlinofchaos’s picture

Status: Active » Fixed

The menu system doesn't support conditional display of menu items, unfortunately, so there is no way to do that using a real menu item.

merlinofchaos’s picture

You could make it a tab on the profile page though.

mshaver’s picture

Status: Fixed » Active

I was able to make this a tab on the user page like you suggested and it works great. The only problem is when I try to validate to the currently logged in user with the PHP code so only a user viewing their own profile would see the tab.

global $user;
return $handler->argument == $user->uid;

It only works if the "Action to take if argument does not validate:" is set to "Display empty text". When set to "Hide view / Page not found (404)", the menu item disappears completely and the view isn't available anymore? Is this because the menu is called before the validate process?

I also tried to use hook_menu_alter in a module to adjust the access callback for this menu item, but had no success. Any idea?

esmerel’s picture

Status: Active » Closed (fixed)

This issue is a year old; it's likely either figured out or no longer relevant.