Last updated November 16, 2008. Created by elcuco on October 17, 2008.
Edited by asak. Log in to edit this page.
How does one 'chop up' a field you ask?
For instance, taking a field with "2.34x3.29x4.20" (let's call it field_sizes), cutting the x's out, and separating the values.
<?php
$my_field = trim($node->sizes[0]['value'],"x");
$values = array();
$my_measures = explode("x", $my_field);
$my_delta = 0;
foreach ($my_measures as $my_measure) {
$node_field[$my_delta]['value'] = trim($my_measure);
$my_delta++;
}
?>and in the display format:
$display = $node_field_item['value'];This takes field_sizes (1.12x9.32x2.12), and choppes (explodes..) it into a field with 3 values (1.12 , 9.32 , 2.12).
Enjoy!