Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By ssan on
I have been struggling to find the variable that gives a node type in drupal 4.7.
I know that node_get_name($type) gives the name of node type, but how do you get the $type (node type) from the first place? My module has 3 newly defined node types (created in hook_node_info)and I have to differentiate which is chosen by a user. Either $node->type or $node->info didn't give a node type.
Any idea? Many thanks for help in advance.
Comments
Post your node_info
post what you have for node_info.
have you checked the database table node to make sure that node->type is being set correctly?