Is there a way to show the actual text for a dropdown or multilist item instead of just displaying the number?

I am using something like this:

print $node->flexinode_25

and I will just get a number like 1,2,3 or 4 outputted.

I would prefer to have the actual label for that dropdown be displayed.

I have tried doing:

print $node->flexinode_25->label

but that doesn't seem to work.

Does anybody have any ideas on how I could do this? If I had to I could probably write a bunch of if statements for each item but this seems like it would be a huge waste of time.

Thanks for any help!

Comments

dww’s picture

you want to use the flexinode_load_field() function.
for example:

  $my_field = module_invoke('flexinode', 'load_field', 25);
  print $my_field->options[$node->flexinode_25];

that should do the trick (i'm assuming you're talking drupal 4.6, since you're using flexinode at all).

-derek

___________________
3281d Consulting

slayerment’s picture

That worked perfect. Thanks!