You are here

function node_content_build_modes in Content Construction Kit (CCK) 6.2

Same name and namespace in other branches
  1. 6.3 content.module \node_content_build_modes()

Implementations of hook_content_build_modes on behalf of core modules.

Return value

An array describing the build modes used by the module. They are grouped by secondary tabs on CCK's 'Display fields' screens.

Expected format: array( // The first level keys (tab1_url, tab2_url) will be used to generate // the url of the tab: admin/content/node-type/[type_name]/display/[tab1_url] // A module can add its render modes to a tab defined by another module. // In this case, there's no need to provide a 'title' for this tab. 'tab1_url' => array( 'title' => t('The human-readable title of the tab'), 'build modes' => array( // The keys of the 'context' array are the values used in $node->build_mode. 'mymodule_mode1' => array( 'title' => t('The human-readable name of the build mode'), // The 'views style' property determines if the render mode should be // available as an option in Views' 'node' row style (not implemented yet). 'views style' => TRUE, ), 'mymodule_mode2' => array( 'title' => t('Mode 2'), 'views style' => TRUE, ), ), ), 'tab2_url' => array( // ... ), );

File

./content.module, line 1918
Allows administrators to associate custom fields to content types.

Code

function node_content_build_modes() {
  return array(
    'basic' => array(
      'title' => t('Basic'),
      'build modes' => array(
        'teaser' => array(
          'title' => t('Teaser'),
          'views style' => TRUE,
        ),
        'full' => array(
          'title' => t('Full node'),
          'views style' => TRUE,
        ),
      ),
    ),
    'rss' => array(
      'title' => t('RSS'),
      'build modes' => array(
        NODE_BUILD_RSS => array(
          'title' => t('RSS'),
          'views style' => FALSE,
        ),
      ),
    ),
  );
}