Closed (duplicate)
Project:
Drupal core
Version:
x.y.z
Component:
node system
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
30 Mar 2004 at 22:11 UTC
Updated:
17 May 2004 at 22:37 UTC
Please bring back user editable teasers. Auto-generated teasers are usefull for blogs and similar sites, but there are lot of situations where possibility to manualy edit the teaser is crucial.
Bringing back teaser field should be easy. I did it with only three lines added in two modules. Of course, more testing is needed, and option in Admin menu to turn on/off teaser field would be welcome.
Comments
Comment #1
mikis commentedThis is my solution (Drupal version 4.4.0-RC, should be similar for older versions), for those who don't program in PHP and don't know how to use patches.
- edit file modules/story.module . Near the end, find line number 131:
$output .= form_textarea(t("Body"), "body", $node->body, 60, 15, ($error["body"] ? theme('error', $error["body"]) : ''). filter_tips_short());and add this line before (or after) it:
$output .= form_textarea(t("Teaser"), "teaser", $node->teaser, 60, 6, ($error["teaser"] ? theme('error', $error["teaser"]) : ''));This is to add Teaser text field on the add / edit node forms. You can change numbers "60, 6" as you like -- 60 is number of characters in one row of textfield, you can increase it if you have larger screen; and 6 is number of rows. Same is for above Body field.
- edit file modules/node.module. There are two lines to be changed: line number 1059, in function node_validate, and line 1363, in function node_preview (you can use search & replace). Both should be changed from:
$node->teaser = node_teaser($node->body);to:
if ($node->teaser == "") { $node->teaser = node_teaser($node->body) };So if teaser field is left empty, it will be generated the usual way.
Comment #2
moshe weitzman commenteddupe of http://drupal.org/node/view/6363
Comment #3
(not verified) commentedThe code that goes into node.module has the } and ; tags reversed, which will cause errors. It should read:
if ($node->teaser == "") { $node->teaser = node_teaser($node->body); }The changes made to story.module can also be made to page.module, allowing you to edit teasers there as well.