Community Documentation

Print the content-type name or label with the 'submitted' info

Last updated August 26, 2009. Created by ugerhard on October 3, 2005.
Edited by ronald_istos, domesticat, puregin, JohnG. Log in to edit this page.

To print the name of a node's content type, add these lines into your theme's node.tpl.php file.

Print the names for all types of nodes

<?php
print node_get_types('name', $node);
?>

Exclude a single content type's name from being printed

<?php
print $node->type != 'page' ? node_get_types('name', $node) : '';
?>

Exclude multiple content types' names from being printed

<?php
if (!in_array($node->type, array('story', 'page'))) {
  print
node_get_types('name', $node);
}
?>

See http://api.drupal.org/api/function/node_get_types/ for more information.

Page status

No known problems

Log in to edit this page

About this page

Drupal version
Drupal 5.x, Drupal 6.x
Audience
Developers and coders, Themers

Theming Guide

Drupal’s online documentation is © 2000-2012 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0. PHP code is distributed under the GNU General Public License. Comments on documentation pages are used to improve content and then deleted.
nobody click here