Drupal 4.7:
I am making a module which specifies a new node type. But I do not wish this node type to have a link in the "create content" page. I did not include a hook_menu function at all, however my new node type still shows up on the "create content" page.

How can I suppress this link?
Thanks!

Comments

clauz’s picture

I had been developing modules for some time copying other modules from drupal in an intuitive way...when I saw your message I decided to start putting comments on the functions of the module until I found that hook_node_name() is the one doing that.
I tested my module after taking that out and everything seems to work fine!

Hope it helps!

Clauz
---------------------------------
http://www.clauz.com.ar
...I am going through A Momentary Lapse of Reason...

dado’s picture

thanks for your reply
unfortunately that sounds like not the best solution, since modules kind of need to implement this hook, i think. any oter suggestions?

dado
http://schtickdisc.org

clauz’s picture

I finally started reading the docs on how to create a module to understand all the functions and in your case you do need it...but maybe you should read this:

http://drupaldocs.org/api/4.6/file/contributions/docs/developer/examples...

It was very useful for me to understand what I was doing with my modules! Hope it helps!

Clauz
---------------------------------
http://www.clauz.com.ar
...I am going through A Momentary Lapse of Reason...

KarenS’s picture

I was also trying to figure out how to control what shows up on the create content page, and couldn't find the answer anywhere, so I thought I'd update this thread in case anyone else is looking for this info.

In 4.7 the function hook_node_info() replaces hook_node_name(), so the previous answer is not quite correct. If you omit hook_node_info() from your module, nothing shows up on the create content page. I originally thought hook_node_info was a required hook, so I wasn't sure if that was the right approach, but carefully reading the info at http://drupal.org/node/22218#node-definition-system it appears that it is only required for modules that are creating node types. So the question is whether your module is creating a node type (one that should appear on node type lists wherever node types are listed).

If you are not trying to create a node type, it appears you can omit the hook entirely. If you are creating a node type but you don't want that particular type to show up on the create content page, add the path info to hook_menu and give it a site admin access. The site admin will see it on the list, but others won't.