function theme_node_add_list

Returns HTML for a list of available node types for node creation.

Parameters

$variables: An associative array containing:

  • content: An array of content types.

See also

node_add_page()

Related topics

1 theme call to theme_node_add_list()
node_add_page in drupal/core/modules/node/node.pages.inc
Page callback: Displays add content links for available content types.

File

drupal/core/modules/node/node.pages.inc, line 69
Callbacks for adding, editing, and deleting content and managing revisions.

Code

function theme_node_add_list($variables) {
  $content = $variables['content'];
  $output = '';
  if ($content) {
    $output = '<dl class="node-type-list">';
    foreach ($content as $type) {
      $output .= '<dt>' . l($type->name, 'node/add/' . $type->type) . '</dt>';
      $output .= '<dd>' . filter_xss_admin($type->description) . '</dd>';
    }
    $output .= '</dl>';
  }
  else {
    $output = '<p>' . t('You have not created any content types yet. Go to the <a href="@create-content">content type creation page</a> to add a new content type.', array(
      '@create-content' => url('admin/structure/types/add'),
    )) . '</p>';
  }
  return $output;
}