Is there a solution for in-place editing of CCK fields? If not.. what would be involved in adding this feature?
After creating a content type with over 50 fields, and I'd love to be able to pop up the widget for each CCK field, edit and submit.

Comments

nedjo’s picture

Activeedit can be extended to add support for a given module by writing a modulename.inc file and adding it to the /modules directory in the activedit module directory. It will be automatically included if the module it's named for is enabled.

In this case, we'd need a content.inc file. It will need, at a minimum, an implementation of hook_activeedit_elements().

This hook returns information on the form fields to attach this behavior to. For an example, see node.inc's function node_activeedit_elements().

The basic node editing framework is already taken care of. What we need to add is just the specific data needed for editing this element. Here are some notes.


  // Each node field should return an item in the $elements['node'] array.
  $elements['node']['node_title'] = array(
    // The tooltip title text that will appear when users hover over the edit button.
    '#title' => t('post title'),
    // The jQuery selector that identifies this element within a rendered node, so that the behavior can be
    // attached.
    // This selector can be overridden for a given theme by including a themename.inc file in
    // the activeedit module's /theme directory.
    '#selector' => 'h2.title > a',
    // The label of the submit button. This is needed to ensure that we don't hide this button when
    // producing an edit form.
    '#submit_text' => t('Submit'),
    // An array identifying the form name and field name.
    '#form' => array(
      // In this case 'node_form' is a special case, as the forms will actually be named for the node
      // type. 
      'node_form' => array(
        // If the element is nested in e.g. a fieldset, we can access it directly by giving the nested keys.
        // E.g., for $form['first_fieldset']['second_element'], we would pass the array 
        // 'first_fieldset', 'second_element'.
        array(
          'title',
        ),
      ),
    ),
    '#require' => 'title',
  );

jcipriani’s picture

Is there a way to activate one field at a time when using custom CCK fields?

A la Flickr, I'd like to be able to double-click the heading and have just the heading turn into a input field.