With my limited (very limited) knowledge of php I would appreciate some pointers...
Trying to multiply my cck "field_length" by "field_participants" to get the computed field "field_userdays". "length" is an integer (days) and participants is an integer too.
My computed field's pertinent settings are
Computed code:
$node_field[0]['value'] = "";
$node->field_length[0]['value'] *
$node->field_participants[0]['value'];
Set to "display this field"
Display format = $display = "$node_field_item['value'];"
Data type = "int"
I'm sure I have some basic code screwed up but the result is my computed field isn't showing. Thanks very much for any tips.
Toddv
Comments
Comment #1
Karlheinz commentedYou have errors in your PHP code. It should be this:
Computed code:
(Note the first line - as it is, you're setting it to a blank string, and not assigning the computed values to any variable)
Display format:
$display = $node_field_item['value'];(Note lack of quotes)
Try making these changes and see how it works.
Comment #2
Toddv commentedI understand. It worked. Thanks very much for your help!
TV
Comment #3
kaizerking commentedHow it works with field collection item?
I have fields:
field_quantity and field_price
i wanted to get field_total vale
Comment #4
dqdDue to the Drupal core life cycle policy and security support advisery, Drupal 6 is no longer supported. So issues for Drupal 6 cannot be longer maintained. The project maintainer has asked for closing all D6 issues to clean up the issue queue. Feel free to reopen the issue if required or set it to "needs to be ported" and latest D8 dev version, if the issue discusses a still missing feature which can be implemented in the D8 version.