In my module I'm generating some json based on some node content.
$node = node_load($nid);
One of the fields in the node is field_sport_type which is of type List (text)
. The allowed values look like this:
mens-surfing|Men's Surfing
womens-surfing|Women's Surfing
junior-mens-surfing|Junior Men's Surfing
junior-womens-surfing|Junior Women's Surfing
skate|Skate
When I var_dump($node), the field_sport_type section looks like this:
["field_sport_type"]=>
array(1) {
["und"]=>
array(1) {
[0]=>
array(1) {
["value"]=>
string(14) "womens-surfing"
}
}
}
So, the 'value' is the key from the allowed values, but I want to get the Label, not the key. In other words, I won't want womens-surfing
, I want to get Women's Surfing
.
How can I get access to the label of my List (text)?