R – How to categorize the content types on the Drupal “Create content” page (/node/add)

drupaldrupal-6

How can I categorize/organize the content types on my "Create content" page? I'm running Drupal 6.x with CCK. I have a lot of custom content types, and my "Create content" page has become a bit unwieldy, as it lists them all alphabetically. I'd like to organize them by category, so users would see something like:

Create Content
    Reports
        Report Type A
        Report Type B
    Events
        Event Type A
        Event Type B

I don't want to mess with Core, but anything else (custom module, theming, existing module functionality) is fair game. I'm hoping I'm missing something easy, because this seems like an obvious requirement, but all I could find on the Drupal site were these unanswered questions:

Best Answer

You should be able to accomplish this in a custom module, without hacking core.

You'll want to implement hook_menu_alter() to take over the callback function for node/add.

Something like

function mymodule_menu_alter(&$items) {
  $items['node/add']['page callback'] = 'mymodule_node_add_page';
}

should get you started. You would then create the function mymodule_node_add_page, and you could use the original callback function as a starting point.

You can also do this at the theme level by overriding theme_node_add_list().

Related Topic