Custom teasers and show summary checkbox The function generating teasers in D6 does not make nice teasers.  At the same time I do not want to bother my users to set teasers themselves, I would rather get rid of the whole system.

Anyway, I tried writing a little helper module which went through the published nodes and tried to correct teasers that were too short or too long.  

My problem:


Between the node_load() and a node_save(), what parts should I care about, just place a &lt;!--break--&gt; in $node-&gt;body or adjust $node-&gt;teaser?
I had the problem after adjusting $node-&gt;teaser and deleting the break; the "Show summary in full view" checkbox was unchecked when manually editing this node.  Which variable is controlling this checkbox and how do I set it?
If I wanted to implement some teaser-corrections via hook_nodeapi(), which event should I hook to, when I do not want to patch the node core module and interfere with its node_teaser() function?


I know there are a couple of modules around, that store teaser data in separate CCK fields.  I would like to avoid this if possible.  (and yes, I want to have a proper value for the teaser variable and not just manipulate the output via views etc.)
Set $node-&gt;teaser to the value you want to use as teaser. That is what node_submit(), the function indirectly called from node_form_submit(), does.
node_body_field(), the function that add the form fields for the node body, contains the following code:




// Check if we need to restore the teaser at the beginning of the body.
  $include = !isset($node-&gt;teaser) || ($node-&gt;teaser == substr($node-&gt;body, 0, strlen($node-&gt;teaser)));

// …

$form['teaser_include'] = array(
  '#type' =&gt; 'checkbox', 
  '#title' =&gt; t('Show summary in full view'), 
  '#default_value' =&gt; $include, 
  '#prefix' =&gt; '&lt;div class="teaser-checkbox"&gt;', 
  '#suffix' =&gt; '&lt;/div&gt;',
);


The checkbox is not selected if


the teaser is set, or
the teaser is not the initial part of the body





I would use hook_nodeapi('presave'), which is invoked before the node is saved, but before hook_nodeapi('insert') or hook_nodeapi('update').


To notice that, if the problem is the length of the teaser, node_teaser(), uses the value of the "teaser_length" Drupal variable as length if the teaser. I am not using Drupal 6, but if I remember well, there should be a setting page that allow to change the value of that variable. If the value of the variable is not modified from a setting page, then you can set it in settings.php, or from a custom module.