1

For CCK fields you can set the display to be hidden for teaser display and shown when in full node display. How can I do the same for a node's body field as it's not listed on the display settings page?

1 Answer 1

1

I don't know of a module that would provide a user interface you could use to achieve what you're after. It is quite simple, however, to put together a tiny module and implement hook_nodeapi('view') to remove the body part from the node content before it is built for display.

The most basic example would be the following, removing the body part from all nodes' teasers:

function YOUR_MODULE_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
  if ($op == 'view' && $a3 /* teaser */) {
    unset($node->content['body']);
  }
}

Just pop a function like this into your module and adjust the if condition as needed.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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