I have a custom view with button in the main tab placed in the local_task tab bar area (Outcomes). I have sub local_task navigation items under that as well that are regular drupal views. (See below)

View | Edit | Outcomes
                    Outcomes Viewer | Custom View | Another Drupal View

When you click on Outcomes you are taken to the Custom View tab or the Default for that custom view. However I want to redirect the Outcomes tab to go to the Outcomes Viewer tab. The Custom View tab is the /default for the menu, so it is s separate link and should work.

However, you can not use /%/ in a redirect. Does anyone have any ideas on how to do this. I have tried the basics but am lost on how to make it work.


  • While this probably could have been done with some php. I ended up building a small custom module and implement hook_menu() to balance out the buttons path and order. – timwhelan Oct 24 '14 at 19:22

So, solving this took a few different directions to figure this one out. The problem was I needed to redirect a view with an argument in the url (node/%/outcomes) to a new sub-button so there was an actual button. (Yes this is also a UX issue that the user needed to have the button)

So, I created a new panel page and in the content area I created new custom content. I used the module, php filter, this way I can use the PHP input for the wysiwyg. Then I pasted this code to redirect.

global $base_url;
header("Location: %node/:nid");

That redirected and kept the argument so everything would work fine. Hope that helps someone!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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