I am trying to: display on the front end the option Display Text instead of its value (or rather in addition to its value). The value is actually an image link, and the name is name of the team whose logo is the image. I need to display both in separate locations and would love not to have to create a second dropdown to select team name, since its already associated with the logo image in the intial dropdown as the display text.
I am using this code to display the image:
<?php $team =types_render_field("mlb-club", array('raw' => true)); if ($team=='N/A') {
echo(types_render_field("mlb-club", array('raw' => true)));
} else { ?>
<img src="<?php
echo(types_render_field("mlb-club", array('raw' => true)));
?>" style="width:100%;height:auto;max-width:100px;" alt="<?php
echo(types_render_field("mlb-club", array('raw' => true)));
?>" /><div style="float:left;width:1px;height:1px;visibility:hidden;"><?php
echo(types_render_field("mlb-club", array('raw' => true)));
?></div><?php }; ?>
I also need to display the option "Display Text" of the image/team name (see screenshot):
Is this possible? It should be in the array for that select field, right? How might I call for that?
Thanks!
I submitted this to the professional support forum since this one showed up in pre-sales questions, so I'll mark this version resolved.
I did manange to half solve this, by getting the custom select field display name and option name to display. However, I need just the option name, and not the select field name to show.
But what I did to get it to show select field name and options name is:
<?php echo(types_render_field("mlb-club", array('show_name' => 'true'))); ?>