Use with nodereference count
Last updated on
30 April 2025
Additional Modules involved: www.drupal.org/project/Nodereference_count
Scenario: Add $50 to a customer's account if they hosted the party 3 times or more.
Fields: Nodereference Count -> counted how many times a person has been referenced in a party hosting event.
Computed Field:
if ($node->field_customer_times_hosted[0]['value'] >= 3) {
$node_field[0]['value'] = 50;
}
else
$node_field[0]['value'] = 0;
this is the first time I've ever used custom php code so please feel free to make corrections, but it works so far.
Help improve this page
Page status: Not set
You can:
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