How can this be done in drupal 7.

I have achieved to display the raw value of this tablefield in views - Global no results but not in the table format.

I have this in PHP-format in the Global - No results behaviour in views

    $view = views_get_current_view();
    $node = node_load( $view->args[0] );
    $table = $node->field_modal_parameters_tabel[und][0]['value'];
    print $table;
    

This gives me this.

a:34:{s:8:"cell_0_0";s:1:"N";s:8:"cell_0_1";s:21:"nat. freq. meas. [Hz]";s:8:"cell_0_2";s:22:"&xij";s:8:"cell_0_3";s:1:"N";s:8:"cell_0_4";s:21:"nat. freq. calc. [Hz]";s:8:"cell_0_5";s:17:"damping calc. [%]";s:8:"cell_0_6";s:7:"MAC [-]";s:8:"cell_0_7";s:11:"delta f ....

But how can I display the table format?

Comments

nimek’s picture

print_r(unserialize($table));

It will return assocciative array.

Or even better
tablefield_rationalize_table($node->field_modal_parameters_tabel[und][0]['value']);

carlovdb’s picture

print_r(unserialize($table)); 

That gives me the array, yes.

but

tablefield_rationalize_table($node->field_modal_parameters_tabel[und][0]['value']);

That gives me An AJAX HTTP error

:(

carlovdb’s picture

Solution thx to gaurav_varshney:

<?php
$view = views_get_current_view();
$node = node_load( $view->args[0] );
$table_data = field_get_items('node', $node, 'field_modal_parameters_tabel');
$output = field_view_value('node', $node, 'field_modal_parameters_tabel', $table_data[0]);
print $output['#markup'];
?>
bleeuwen’s picture

Hi
When you change:
Or even better
tablefield_rationalize_table($node->field_modal_parameters_tabel[und][0]['value']);

in:
Or even better
tablefield_rationalize_table(unserialize($node->field_modal_parameters_tabel[und][0]['value']));

It is OKE

lolandese’s picture

Status: Active » Fixed

This seems to be answered. Feel free to reopen if still help on this issue is needed using the latest version.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.