Hi, Im trying to access to a subfield called 'field_hello' inside of a field called 'field_imputaciones' can anyone tell me please how to get thouse values?

Thanks in advance!

This will be the normal code if the field were not a subfield.

$field_items = field_get_items($entity_type, $entity, $field['field_hello']); 

$total = 0;
foreach ($field_items as $item) {
  $total += $item['value'];
}


$field_b = field_get_items($entity_type, $entity, "field_pagado_alqu");


$entity_field[0]["value"] = $field_b[0]["value"] + $total;

Diseño web Palma de Mallorca

Comments

Diseño web Mallorca created an issue. See original summary.

Diseño web Mallorca’s picture

Category: Support request » Bug report
Diseño web Mallorca’s picture

Issue summary: View changes