On this page
Current Node Email field token
setup token
use the token custom module to create a new custom token with name "nodeemail" of TYPE: custom
and use php filter with following code
if(arg(0)!="node")
return "not viewing a node";
$node = node_load(arg(1));
return $node->field_email['und'][0]['email'];
now wherever you have tokens available you can use [custom:nodeemail]
NOTE1: assuming that email field has machine name field_email and is not translatable ('und') otherwise change accordingly
NOTE2: to get more node fields use echo print_r($node); in the custom token or look at http://drupal.org/node/49768
Who needs this custom token ?
webform 4.x adds support for tokens but if webform is attached to node using "webform block" the tokens are not populating the webform fields as reported in #1544044: Attach webform to node, email to field from node and #1617086: Webform > E-mails: Add "Content values" (ie: node field) support so custom token is needed
This custom token might not be needed after this issue is resolved #919760: Add a [current-page:object:?] dynamic token
Help improve this page
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion