I have a field which contains a price. In the matrix tpl.php I theme it like below. Unless I use the escape code, the currency symbol is viewed wrong. This only happens in the matrix field, when I output the same

In my content type this character comes from another CCK field.

Example code

Shows the wrong character, in my Firefox 3 it looks like a diamond with a question mark:
<?php
$manipulated_data[$row_index][$column_index] = '<div class="number">' . '£ ' . $field_currency_rendered . format_number($cell_value, 0) . '</div>';
?>

Shows the correct GBP pound sign:
<?php
$manipulated_data[$row_index][$column_index] = '<div class="number">' . '&pound; ' . $field_currency_rendered . format_number($cell_value, 0) . '</div>';
?>

Of course its preferable to escape characters like this, but its still a bit curious why matrix views it wrong when it views correct outside it.

Comments

tsvenson’s picture

Gets even more interesting.

When I use:

$node->content['group_rates']['group']['field_currency']['field']['#children']

in the tpl.php to print the currency symbol £ (not escaped) is viewed properly?!?!?

aaron1234nz’s picture

Status: Active » Closed (fixed)

This issue is outside the scope of this module i'm afraid so I'm closing this issue