I'd like to edit CCK so that the title pulls data from a field_first_name and field_last_name.
I searched the Drupal forums extensively and found a few questions about the same thing, but never an answer that has worked for me. I found (http://drupal.org/node/79671) but it doesnt quite work for me. When I use it instead of getting the data from field_first_name I get the text: "field_first_name".
Here is an excerpt of the content.module code:
function content_form_alter($form_id, &$form) {
// Check if we are on a node editing form for our type.
if (isset($form['#node']) && ($node = $form['#node']) && $form_id == $node->type .'_node_form') {
if ($node->type == 'content-player_profile') {
$form['title']['#type'] = 'value';
$form['title']['#value'] = 'field_first_name';
}
}
return $form;
}
/**
* Implementation of hook_nodeapi().
*
* When a revision is deleted, make sure the appropriate cache item is cleared.
*/
function content_nodeapi(&$node, $op, $teaser, $page) {
switch ($op) {
case 'delete revision':
if (content_types($node->type)) {
_content_field_invoke('delete revision', $node);
_content_field_invoke_default('delete revision', $node);
cache_clear_all('content:'. $node->nid .':'. $node->vid);
}
break;
if ($op == 'validate' && $node->type == 'content-player_profile') {