Hi,

I have alot of experience with PHP and as yet I have achieved everything that I have needed the Computed Field Module for..

One thing that I'm currently trying to achieve is putting some fields together, not adding them up (Numbers) but rather adding the words together. What I have is three fields:

Forename, Surname and Position

I want to put all of these together in to a computed field?

Any ideas..? Possible? Impossible?

If possible, please reply.. .. Its also something that could be added to the documentation, I know a number of people who have been trying to accomplish this

--
Whispero

Comments

sdsheridan’s picture

Totally possible. In the computed code text area, use something like:

$node_field[0]['value'] = $node->field_forename[0]['value'] . ', ' . $node->field_surname[0]['value'] . ' - ' . $node->field_position[0]['value'];

and then in the display text area, use:

$display = $node_field_item['value'];

That should do it.

shawn

whispero’s picture

Status: Active » Closed (fixed)

Closing out this as issue has now been rectified.

- Whispero