Try to generate block for better display
vistree - October 8, 2008 - 18:00
| Project: | Computed Field |
| Version: | 6.x-1.0-beta1 |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
Hi, I tried using computed fields to generate a surrounding div around some fields.
OK, I have three field where I get the value[0] from and want to display them in my computed field.
$node_field[0]['value'] = $node->field_field1[0]['value'];
$node_field[1]['value'] = $node->field_field2[0]['value'];
$node_field[2]['value'] = $node->field_field3[0]['value'];field1 contains a telephon number, field2 a fax number and field3 an email-adress.
I use disply field and as display format:
$display = $node_field_item['value'];Datatyp is varchar and I enabled "storing in database"
As the result only the value of nod_field[0] is displayed.
What is wrong??
Regards
vistree

#1
Well this one is quite old, and not really a bug report, but on the off chance you're still interested. :)
My guess is that you're trying to store those multiple values in a computed field that's set to only accept 1 value. You'd want to take a look in the field settings for your computed field and make sure it's set for at least 3 values in your case.
FWIW though, if all you're looking to do is wrap a few fields in a div, then you really want to take a look at Drupal themeing a bit. You can make a change like that very easily in a template file rather then using computed fields.
Hope that helps...