views:

346

answers:

2

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:

+2  A: 

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().

jhedstrom
+1  A: 

There are some different ways to attack this problem. You can overwrite the old form page or just create a new one with a custom module. Doing that you can in your module do whatever your want.

Another possibility is to do the same thing using views instead. Doing that gives you access to a lot of powerfull features, as you can do anything the views module lets you do. You can create different ways of sorting the content types.

I've heard of many who have used views to make a page like this for the create content page. Which method you choose is up to you, depending on how exactly you want to do this and the data you have associated with your content types, one will be more easy than the other. But without knowing the exact details, I can't say which. I would advise you to start out with views, since you quickly should be able to find out, if you can use it to get what you want.

googletorp

related questions