Problem in cck field theming :

I have a cck field and select list "key|value"
01|text1
02|text2
03|text3
etc

In the node theme I can only display «key», but not «value»
For example
<?php print $node->field_myfield['fr'][0]['value'];?>
Will display «02» while I had like «text2»

When I display the full node content with
<?php print_r($node);?>
I can find «02», but nowhere «text2».

Thanks in advance for your help

Comments

ziobudda’s picture

Hi, I think that you can use $field_myfield['fr'][0]['view'] or $node->field_myfield['fr'][0]['view'] (in this moment I can not check for it).

M.

Freelancer Senior Drupal Developer -- http://www.ziobuddalabs.it

gilbertdelyon’s picture

In the meantime I found 2 ways to display "value" instead of "key"

<?php 
print $content['field_myfield'][0]['#markup'];
//or
print render($content['field_myfield']);
//In the second way the content cant vary as per  "myfield" display settings.
// To get only "value" I need to set label as <hiden> and format as Default.
?>