• Resolved Avantart

    (@avantart)


    Please explain the function of label and field?

    And how to define the output? When I select field + label in the dialogue and add “before text” to the field, the “after-text” of the label is displayed without any space between label and the field content.

    Why both items (field + label) have “before-” and “after-” text?
    What is displayed when both are filled? I only see the “before”-output of the label and that is glued without any padding to the fieldcontent.’

    I really need info, in textual style, videos don’t help me…

Viewing 1 replies (of 1 total)
  • Plugin Author gamaup

    (@gamaup)

    Hi!

    Is the field type you’re trying to load a Select field? If so, here’s how it works:

    • A Select field in ACF lets you define choices in the format of value : label.
    • The value is what’s actually stored in the database.
    • The label is the human-readable text that is shown in the dropdown.

    For example:

    red : Red Color
    blue : Blue Color
    green : Green Color

    In this case:

    • red, blue, green are the values.
    • Red Color, Blue Color, Green Color are the labels.

    When you load the field in the editor using ACF Field block, you can choose whether to display the value or the label depending on your needs. And this works the same no matter what your ACF field return setting is.

    Regarding your other point: when you mention “before” and “after” text, do you mean the Prefix and Suffix options?

    • Prefix is static text that appears before the field value.
    • Suffix is static text that appears after the field value.

    If you want a space between the label and the field content, you’ll need to add a literal space in the Prefix or Suffix field (for example: ": " instead of just ":").

    Hope it explains.

Viewing 1 replies (of 1 total)

The topic ‘field and label’ is closed to new replies.