20

in Drupal 7, which function do I need to call to get the name of the content type? I have the $node object and I also have the id of the content type if I use $node->type. But I need to get the name of the content type set in the system, not the ID as something like 'name_of_the_content_type'. I need it as 'Name of the content type'.

Thank you.

18

Try calling this function

node_type_get_name($node)

Returns the node type name of the passed node or node type string.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.