How to display only first value from Select Multiple Field?

More
7 years 8 months ago - 7 years 8 months ago #67108 by lipatovroman
HI!

OK, I've got values array and found the smallest number.
Code:
$field_id = 35; $fvals = $item->fieldvalues[$field_id]; // or $items[$i] for category view $minvalue = min ($fvals);

Now, how I can display label for this value?

I tried modified your code
Code:
$field_id = 35; $fvals = $item->fieldvalues[$field_id]; // or $items[$i] for category view $minvalue = min ($fvals); $elements = FlexicontentFields::indexedField_getElements( $item->fields["android-compatibility"], $item, $extra_props ); $value = @ $elements[$v]->value; $label = @ $elements[$v]->label; echo 'value: ' . $value . ' - '; echo 'label: ' . $label . ' <br/>';

But it does not work...

So, main question: how to display label for specific value in field.

Last edit: 7 years 8 months ago by lipatovroman.

Please Log in or Create an account to join the conversation.

More
7 years 8 months ago #67109 by lipatovroman
YES! I got it.
Code:
$field_id = 35; $fvals = $item->fieldvalues[$field_id]; // or $items[$i] for category view $minvalue = min ($fvals); $elements = FlexicontentFields::indexedField_getElements( $item->fields["android-compatibility"], $item, $extra_props ); $value = @ $elements[$minvalue]->value; $text = @ $elements[$minvalue]->text; echo 'value: ' . $value . ' - '; echo 'text: ' . $text . ' <br/>';

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.419 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline