0

In https://drupal.org/node/514318 it talks about how to disable showing the summary/teaser in full view mode but only for D7 it seems.

In my D6 based site, I've filled in meta-description in the node teaser as required by Nodewords module.

The problem is that in full view mode it is clubbing this node teaser with the node's body text. Is there any option to avoid it adding with the body content?

In the picture from dsm($form) in hook_form_alter when editing node we can see there is teaser_include array key with #default_value = TRUE. I'm wondering where in the Admin interface we can specify this setting.

enter image description here

  • If you goto admin/content/node-type/NODETYPE/display where NODETYPE is the actual node type you are talking about, you can specify what fields are displayed and how in the $content variable in node teasers and full views. That's where I'd start looking first. – Jimajamma Nov 11 '13 at 18:36
  • My question is different, how to avoid clubbing of teaser with node's body content. It isn't there in the display options. – AgA Nov 12 '13 at 4:23
0

I've written a form_alter function for node edit form that has solved my problem:

function my_form_alter(&$form, &$form_state, $form_id) {
    if ($form_id == 'page_node_form') {
        $form['body_field']['teaser_include']['#default_value'] = FALSE;

        $prefix = $form['#node']->teaser;
        $str = $form['body_field']['body']['#default_value'];

        if (substr($str, 0, strlen($prefix)) == $prefix) {
            $form['body_field']['body']['#default_value'] = substr($str, strlen($prefix));
        }

    }
}

Also the teaser_include as in the question is from the node edit form which is accessible from this checkbox: enter image description here

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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