summaryrefslogtreecommitdiff
path: root/modules/node/node.module
diff options
context:
space:
mode:
Diffstat (limited to 'modules/node/node.module')
-rw-r--r--modules/node/node.module29
1 files changed, 22 insertions, 7 deletions
diff --git a/modules/node/node.module b/modules/node/node.module
index 4de27a479..bc59ea9b3 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -189,12 +189,15 @@ function node_entity_info() {
'view modes' => array(
'full' => array(
'label' => t('Full content'),
+ 'custom settings' => FALSE,
),
'teaser' => array(
'label' => t('Teaser'),
+ 'custom settings' => TRUE,
),
'rss' => array(
'label' => t('RSS'),
+ 'custom settings' => FALSE,
),
),
),
@@ -206,9 +209,11 @@ function node_entity_info() {
$return['node']['view modes'] += array(
'search_index' => array(
'label' => t('Search index'),
+ 'custom settings' => FALSE,
),
'search_result' => array(
'label' => t('Search result'),
+ 'custom settings' => FALSE,
),
);
}
@@ -231,6 +236,16 @@ function node_entity_info() {
}
/**
+ * Implements hook_field_display_ENTITY_TYPE_alter().
+ */
+function node_field_display_node_alter(&$display, $context) {
+ // Hide field labels in search index.
+ if ($context['view_mode'] == 'search_index') {
+ $display['label'] = 'hidden';
+ }
+}
+
+/**
* Entity uri callback.
*/
function node_uri($node) {
@@ -562,10 +577,8 @@ function node_add_body_field($type, $label = 'Body') {
'label' => $label,
'widget_type' => 'text_textarea_with_summary',
'settings' => array('display_summary' => TRUE),
-
- // Define default formatters for the teaser and full view.
'display' => array(
- 'full' => array(
+ 'default' => array(
'label' => 'hidden',
'type' => 'text_default',
),
@@ -588,10 +601,12 @@ function node_field_extra_fields() {
foreach (node_type_get_types() as $type) {
if ($type->has_title) {
$extra['node'][$type->type] = array(
- 'title' => array(
- 'label' => $type->title_label,
- 'description' => t('Node module element.'),
- 'weight' => -5,
+ 'form' => array(
+ 'title' => array(
+ 'label' => $type->title_label,
+ 'description' => t('Node module element'),
+ 'weight' => -5,
+ ),
),
);
}