0
function mymodule_menu_local_tasks(&$variables) {
   if ( request_path == 'yadda') :
   ....
}

I can do that.. but the problem is I want to include this for the tabs on user/$id/edit and I'd rather not do regex or check the beginning and end of the string...

Is there some way I can pull a variable that relates to that specific page type?

1 Answer 1

3

You can tell if you're on a node page with menu_get_object(), but other than that it's difficult. menu_get_object() can return other objects than a node, but you need to know the type of entity before you call it (not much help in your situation). There's no generic solution that I know of in Drupal 7.

There is the drupal_match_path() function though, which you can use with wildcards, e.g.

if (drupal_match_path(request_path(), 'user/*/edit')) {
  // On a user edit page
}
1
  • great! that seems to be doing the trick thank you.
    – Damon
    Commented Jan 25, 2013 at 14:10

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.