Untitled node in Drupal

I want to have a content type, namely quote usign CCK. But the quotes have no name at all. But since the header is a required field, how can I avoid placing the header when creating a new node.

+3
source share
2 answers

Check out the Nodetitles Automatic module , which should facilitate what you want to do.

+8
source

- YOUR_CONTENT_TYPE_node_form. , , , , quote_node_form. , ,

  • ,
  • Hidden

quotetitlenotrequired ( , ).

  • () sites/all/modules quotetitlenotrequired

  • sites/all/modules/quotetitlenotrequired quotetitlenotrequired.info quotetitlenotrequired.module

  • quotetitlenotrequired.info:

    ; $Id$
    name = Quote Title Not Required
    description = Makes node titles not required for quotes.
    core = 6.x
  • quotetitlenotrequired.module:

    <?php
    // $Id$
    
    /**
     * @file
     * Makes node titles not required for quotes.
     */
    
    /**
     * Implements hook_form_alter().
     */
    function quotetitlenotrequired_form_alter(&$form, &$form_state, $form_id) {
      if ($form_id == 'quote_node_form') {
        $form['title']['#required'] = FALSE;
        // Remove the next line if you still want the title field to be visible
        $form['title']['#type'] = 'hidden';
      }
    }
    
  • www.yoursite.com/?q=admin/build/modules

  • Quote Not Required ( "" )

  • " "

, , . , $form['title']['#type'] = 'hidden';, .

, ...

:)

0

Source: https://habr.com/ru/post/1750442/


All Articles