I keep researching this issue but I still cannot decide if it's a feature or a bug.
With a module which defines its own node types, the said node types are not listed at node/add.
Since D6, the menu system creates the listing: #113898: Let the menu system generate the node/add summary page.
However, everywhere I look, it is said that in 6.x you don't define node/add items in hook_menu anymore, they're created from hook_node_info..
This is noted in the documentation here:
http://drupal.org/node/114774#node_add_summary
The node/add/$type menu items are now auto-generated by the menu system. You should not declare them in your menu hook.
This is echoed in several issues that I found. hook_menu_alter() ought to be used when you want to hide it or otherwise modify it.
Yet, without using hook_menu() or hook_menu_alter() I cannot succeed in having my new node type appear at node/add.
I checked the node type creation tutorial:
http://drupal.org/node/231019
I even downloaded the whole code and created an actual module with it. (see attached). The node type admin page works. The node/add/hook page works. But the menu item does not appear in node/add. Instead, it appears in the root navigation menu.
If there is a mistake in my implementation, then there is a mistake in the documentation, too.
Here are a few related issues:
#64882: Add non-node type to create content page
#359231: hook_menu_alter does not affect the node/add/[content] menu items
#169049: content types without form listed in node/add The opposite problem as the current one!
#178816: hook_menu_alter() usage
| Comment | File | Size | Author |
|---|---|---|---|
| hook.module.txt | 2.03 KB | beginner | |
| hook.info.txt | 61 bytes | beginner |
Comments
Comment #1
beginner commentedThe above has been tested with D6. The problem is probably the same for D7.
Comment #2
beginner commentedHmmm. Apparently it was something to do with a faulty D5 => D6 upgrade. Menu items were duplicated and some hidden. The problem does not occur on a clean DB.