0

Is there a way to generate a list of "standard" clean URLs, like /user/login, `/admin/content/comment', '/comment/NN' ? Perhaps for core modules, or for a specified set of modules?

0

1 Answer 1

2

Those are paths in Drupal lingo. Clean URLs come from a server configuration that rewrites the path query parameter away (e.g. http://example.com/?q=user/login vs http://example.com/user/login ).

To get at the heart of your question, registered paths can be found in the menu_router table of your Drupal installation. There is no one standard set of paths since any module can register a path. Thus, the "standard" result will vary based on what type of install you have (e.g. minimal vs standard vs contrib installation profile) plus other configurations.

For example, this code snippet will dump the list of paths that the 6 core modules are registering.

  $implementations = module_implements('menu');
  $core = array('field', 'field_sql_storage', 'filter', 'node', 'system', 'user');
  $paths = array();
  foreach($implementations as $implementation) {
    if(in_array($implementation, $core)) {
      $paths = array_merge(array_keys(call_user_func("${implementation}_menu")), $paths);
    }
  }
  var_dump($paths);

However, you'll find the node paths will vary across your installation based on the your defined node types (e.g. node/add/NODE_TYPE ).

1
  • So select path, access_callback from menu_router; anyway, the paths from core modules would be the most important
    – dan3
    Commented May 15, 2015 at 9:38

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.