5

Every now and then, mostly when looking at a new site, I find myself wanting to know

What's the source of this particular page?

Usually, I end up starting to dig in the menu_router table, and possibly also alias tables. Is there a module that will be helpful in finding and displaying this, and other relevant, information for me?

closed as off-topic by Pierre.Vriens, kiamlaluno Jan 21 '17 at 13:08

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions asking to recommend or find a book, tool, module, theme, distribution, tutorial, or other off-site resource are off-topic for Drupal Answers as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it." – Pierre.Vriens, kiamlaluno
If this question can be reworded to fit the rules in the help center, please edit the question.

  • What information about the route/aliases are you looking to display? Page callback/arguments, access callback/arguments, etc...? – Clive Jun 19 '13 at 10:11
  • The information I've found myself looking for repeatedly is the page callback, and sometimes, because it's aliased, that requires finding the current URL I'm looking at among the aliases. But if a module is able to dig out the hook_menu item, then having all of it displayed would make sense I guess. :) – Letharion Jun 19 '13 at 10:29
  • It probably wouldn't be a terribly complex module to write myself, I just don't want to spend the effort if someone's already done it. It could even be that devel can do it and I've never noticed. – Letharion Jun 19 '13 at 10:34
4

I'm not sure there's a module specifically for that, if anything I think it would come under the domain of Devel as you mentioned in the comments. I haven't seen anything like that in Devel before though.

Getting the router item for the current path itself is very easy:

$item = menu_get_item();
$callback = $item['page callback'];
// etc...

You could just wrap that in a hook_init() and dpm() it out for a quick solution, or maybe build a patch up for Devel.

  • Oh, cool. I didn't know about menu_get_item()! :) – Letharion Jun 19 '13 at 15:00
  • 1
    Me neither...I started typing menu_ in my IDE's autocomplete and let it tell me what to do ;) Now if I could only train it to write all my code for me... – Clive Jun 19 '13 at 15:03

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