Grayside.Org

Home

Remove CCK Fields from the Node Form

grayside — Thu, 11/12/2009 - 15:05

There is a fine tutorial on drupal.org describing How to set the disabled attribute of a CCK field on your node add/edit form. All that does is deactivate the input widget without removing the clutter. Let's get rid of the form elements entirely.

To actually remove the field from the input form, change the _mysnippet_fix_disabled() function to the following:

function _mysnippet_set_denied(&$elements) {
   foreach (element_children($elements) as $key) {
     if (isset($elements[$key]) && $elements[$key]) {
      // Recurse through all children elements.
          _mysnippet_set_denied($elements[$key]);
      }
  }
  $elements['#access'] = FALSE;
}

  • cck
  • drupal
  • how-to
  • node-form
  • Add new comment

Similar Posts

  • CCK Fields and the Open Atrium Node Form
  • Zero Configuration Multisite
  • Moving OpenAtrium Node Form Elements to the Right Column
  • Overriding Prepopulate: Do Not Use hook_form_FORM_ID_alter
  • Atrium Casetracker: Change Which Case Statuses are "Closed"

Monthly archive

  • March 2010 (4)
  • February 2010 (2)
  • November 2009 (7)
  • October 2009 (1)
  • September 2009 (5)
  • August 2009 (1)
  • July 2009 (1)

Feeds

Syndicate contentHeadlines

casetracker cck drupal fields FL3 freelinking how-to module node-form openatrium permissions plugin
<all>

© 2009 grayside.org ♠ Glossary ♠ Powered by Drupal ♠ Floating on Archlinux