[SOLVED] [Drupal Webform] Get the nid of the current node where the Webform block is placed
Webforms can be placed easily in a block in a Drupal website. You might face a scenario in your Drupal website where you have to place a Webform in a block and you need to get the nid of the node where the Webform block is placed to get an idea of which article the user was reading when they submitted the form. There could be other users for it too. Read on to find out how to implement it.
Follow the steps below to get the nid of the current node where the webform block is placed.
- Firstly make sure your form has a hidden field
- Next find out the Webform id
- Create a custom module and place the following code there. If you already have a custom module place the code there.
title;
}
}
}
?>
Hope that helps.
The easiest way to solve a Drupal issue is to hand it to the Drupal experts. We can provide a wide range of Drupal services to help you maintain and manage your Drupal websites. Get in touch with us to know more.
Reference: http://drupal.org/node/1470748