Posted By

berkes on 06/14/07


Tagged

drupal formalter webschuur TRS


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

basicmagic
panatlantica
mbria


Drupal formalter for a separate teaser field


 / Published in: PHP
 

URL: http://drupal.org

A form alter to gove Drupal a separate teaser field.

  1. /**
  2.  * Implementation of hook_form_alter().
  3.  */
  4. function separate_teaser_form_alter($form_id, &$form) {
  5. if (isset($form['type']) && ($form['type']['#value'] .'_node_form' == $form_id)) {
  6. $form['teaser'] = array(
  7. '#type' => 'textarea',
  8. '#title' => t('Teaser'),
  9. '#description' => t('The teaser is used as short introduction of this post. It is displayed in all sorts of listings. If this is left empty, the system will create a teaser automatically.'),
  10. '#weight' => $weight,
  11. '#default_value' => $node->teaser,
  12. '#required' => $required,
  13. );
  14. }
  15. }

Report this snippet  

You need to login to post a comment.