In my setup (including CCK) the description of a webform is rendered below the form not above. I did not find another solution but to change the weight of the $node->content['webform'] field to make sure it's higher than any other cck field. This should be clearly fixed more properly by the module itself by assigning a weight according the weight of the other node fields. The attached patch should help in most cases for the meantime.

Comments

cdale’s picture

A better solution would be use hook_content_extra_fields_alter. Something like:


function webform_content_extra_fields_alter(&$extra, $type_name) {
  if ($type_name == 'webform') {
    $extra['webform'] = array(
      'label' => t('Webform'),
      'description' => t('webform display'),
      'weight' => 1,
    );
  }
}

I haven't actually tested this code myself, but I've done something similar in other modules. This way, you can adjust the weight on the webform content type page via CCK.

quicksketch’s picture

I agree, cdale's approach would be preferable if we're going to be making changes to the weights.

matulis’s picture

Thank You, CDALE!
Tested and works smoothly.

Mac Clemmens’s picture

Status: Needs work » Reviewed & tested by the community
StatusFileSize
new511 bytes

Tested cdale's recommendation and it worked great! I recommend that it be committed to webform. I've rolled a patch of the changes.

vegancheesesteak’s picture

This is extremely useful! Thank you!

moritzz’s picture

Wow, I didn't knew there's such a elegant solution. Thanks cdale.

jkristos’s picture

I think I'm missing something obvious.
With cdale's above code in template.php, where should I be able to set the weight of that field?

quicksketch’s picture

Version: 6.x-2.6 » 6.x-2.8
Category: bug » feature
Status: Reviewed & tested by the community » Fixed
StatusFileSize
new833 bytes

Thanks, I cleaned up the documentation and comments and committed to the Drupal 6 2.x version.

quicksketch’s picture

jkristos, This is a change to the module file, not to your theme. After applying the patch, you can reorder the field through CCK's interface for ordering fields at admin/content/node-type/webform/fields.

quicksketch’s picture

Title: "Description" aka body rendered below the form not above » Allow Webform form location to be reordered through CCK field ordering

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.