displaying a State from a select broke

Support MB Views displaying a State from a select broke

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #36090
    Jim HJim H
    Participant

    I have a basic address set up and they State field is a select box. I have a view that displays the address. It has always worked, but I was just alerted that it no longer shows the state value, instead it displays 'Array'. The data in the database is just the value for the state, it's not in array format. The view is just using {{ post.exh_state }} and like I said, has been working for a while. In order to get it to display correctly, I had to change it to {{ mb.get_post_meta( post.ID, 'exh_state', true) }}. So it looks like there is a minor bug that slipped into the latest update.

    Jim

    #36101
    Long NguyenLong Nguyen
    Moderator

    Hi Jim,

    If you use the code post.exh_state, it will return an array of a value and a label of the select field. You can use this code to output the value or label.

    {{ post.exh_state.value }}
    {{ post.exh_state.label }}

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.