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
  • Modifying Contexts the Old-Fashioned Way
  • Firefox's Custom Keywords and Drupal
  • Optional Spaces Integration for a View

Monthly archive

  • July 2010 (2)
  • June 2010 (6)
  • May 2010 (9)
  • April 2010 (5)
  • March 2010 (6)
more

Feeds

  • Syndicate contentHeadlines
  • Syndicate contentDrupal Planet
  • Syndicate contentAtrium Headlines

casetracker cck drupal features FL3 freelinking module og openatrium permissions plugin spaces
<all>

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