MB Blocks - Select type field - lowercase vs capital letter

Support MB Blocks MB Blocks - Select type field - lowercase vs capital letter

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #31645
    flowxdflowxd
    Participant

    Hi, I followed your "Build Gutenberg Blocks Visually With MB Builder" tutorial (https://www.youtube.com/watch?v=v3ke1DBlWuk) and I can't figure out one thing:

    When I use Select type Field with choices as below:
    warning: Warning
    error: Error
    success: Success
    the created alert block doesn't change color as it changes in your tutorial.

    However, if I use lowercase only
    warning: warning
    error: error
    success: success
    all colors change properly without any problems.

    I recorded screencast with the example https://youtu.be/NX4hKGGv5RE

    Could you please point me what I am doing wrong?

    I have kind of OCD and I would prefer to use a capital letter instead of lowercase in the Select type field.

    #31652
    Long NguyenLong Nguyen
    Moderator

    Hi,

    I got the issue. If you use the code {{ type }}, it will output the label of the option. You can change it to {{ mb.mb_get_block_field( 'type') }} to output the value.

    Get more details here https://docs.metabox.io/extensions/mb-blocks/#render_callback

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