I made a rule that sends emails to an arbitrary address.

But for some reason, this won't parse, leaving a blank space in the email.

print $node->content['group_nd']['field_tname']['#value'];

however, this did:

print $node->nid;

Why?

I even tested trying to print a field value that isn't inside a group:

print $node->content['field_test']['#value'];

but no dice, any ideas? do I have my syntax wrong?

Comments

ballerjones’s picture

bump, anyone? easy question, I think

ballerjones’s picture

one last bump

Anonymous’s picture

try doing something like

  print "<pre>" . print_r($node,true) . "</pre>";

it should give you all available fields. Where have you inserted the code?

WorldFallz’s picture

Depending on what type of field it is, the proper syntax should be:

<?php
print $node->field_test[0][value];
?>
ballerjones’s picture

EDIT: No need to specify a group. However, what are my display options? For instance, if a field value is a date time. i.e. May 5th to May 6th. How can I show this properly?

WorldFallz’s picture

To see the structure of the fields in a node use the code tirsales posted above.

ballerjones’s picture

that worked. you guys are geniuses, helpful ones.

ballerjones’s picture

it is a text field, I will test this out. How do i also specify a field group? thanks worldfallz.