Trimmed Post Length
kesmeby - June 7, 2006 - 14:52
| Project: | Teaser module |
| Version: | HEAD |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
I thought it would be nice if the character limit in the "Length of Trimmed Post" setting (Admin>Settings>Posts) was a field where users could enter a number instead of a pulldown menu. It looks like a few people have posted questions about wanting to change the number of characters to a value not given.
thanks,
kyle

#1
That would be nice.
I think I found where it is generated from:
File: node.module
Lines: 980-991 (specifically 985-991)
$form['teaser_length'] = array('#type' => 'select', '#title' => t('Length of trimmed posts'), '#default_value' => variable_get('teaser_length', 600),
'#options' => array(0 => t('Unlimited'), 200 => t('200 characters'), 400 => t('400 characters'), 600 => t('600 characters'),
800 => t('800 characters'), 1000 => t('1000 characters'), 1200 => t('1200 characters'), 1400 => t('1400 characters'),
1600 => t('1600 characters'), 1800 => t('1800 characters'), 2000 => t('2000 characters')),
'#description' => t("The maximum number of characters used in the trimmed version of a post. Drupal will use this setting to determine at which offset long posts should be trimmed. The trimmed version of a post is typically used as a teaser when displaying the post on the main page, in XML feeds, etc. To disable teasers, set to 'Unlimited'. Note that this setting will only affect new or updated content and will not affect existing teasers.")
);
I tried changing the type to text instead of select and removing the array of options, but that just makes the whole option disappear altogether.
#2
It would be very helpful for us to obtain the functionality where a user would select a segment/paragraph that one would like to display as a teaser instead of picking the first 200 random characters in the text.
Is that something that could be easily done?
Thanks in advance,
Mike