It works :)
After many attempts to get it right this is the code I used:
// subject field: if (variable_get('comment_subject_field', 1)) { $node = node_load(array('nid' => $edit['nid'])); $form .= form_textfield(t('Subject'), 'subject', $edit['subject'] ? $edit['subject'] : t('Re: '). $node->title, 60, 64); }
It works correctly, the syntax is okay too?
----- Original Message ----- From: "Bèr Kessels" berdrupal@tiscali.be To: drupal-support@drupal.org Sent: Saturday, September 10, 2005 2:47 PM Subject: Re: [drupal-support] Locking comment subject to the node title
Op zaterdag 10 september 2005 13:18, schreef Abalieno:
$form .= form_textfield(t('Subject'), 'subject', $edit['subject'] ? $edit['subject'] : 'Re: '. $node->title, 60, 64);
This should be $form .= form_textfield(t('Subject'), 'subject', $edit['subject'] ? $edit['subject'] : t('Re: '). $node->title, 60, 64);
And AFAIK there is a 'nid' ni the comment oject A node_load() with that nid will give you the parent node object.