Hi all,
please forgive me if this is the wrong place where to post this...
I had the following problem: I wanted to end the teaser of a node with a string, because looking at the front page of my site it was not clear if the content of the articles was truncated or simply short. Afer poking around with Drupal code I found the solution posted here: I do not know if this is the correct or the better solution, give me some feedback. The only drawback is that it is a modification of the node module, that is fundamental for Drupal.
node.module
148,149d147
< $endstring = variable_get('teaser_endstring', '');
<
160c158
< return substr($body, 0, $delimiter) . "\n" . "$endstring";
---
> return substr($body, 0, $delimiter);
192c190
< return ($position == 0) ? $teaser : substr($teaser, 0, $position) . "\n" . "$endstring";
---
> return ($position == 0) ? $teaser : substr($teaser, 0, $position);
207c205
< return ($position == 0) ? $teaser : substr($teaser, 0, $position) . "\n" . "$endstring";
---
> return ($position == 0) ? $teaser : substr($teaser, 0, $position);
1012,1015d1009
< $form['teaser_endstring'] = array(
< '#type' => 'textfield', '#title' => t('Teaser end string'), '#default_value' => '', '#description' => t('This string will be appended at the end of the teaser')
< );
Feedbacks are welcome!
Leo