Support

Account

Home Forums General Issues Output Select label, based on page parent ID Reply To: Output Select label, based on page parent ID

  • This combination output the label correctly, thanks for the pointers.

    <?php
    /*
    *  Displaying a single value's Label
    */
    $field = get_field_object('color');
    $value = get_field('color');
    $label = $field['choices'][ $value ];
    ?>

    Another question on the same issue has raised though. I have a page, with a colorscheme set as described above, also within the page, I have a Repeater Field, which has a sub-field to set a colorscheme.

    I’d like to use the same set of color options I’ve set in Options. This works fine if the sub field is named “color”, as this will pick up the choices for a select list. But when these are output, things get confused between the pages colorcheme, and the repeater field box colorscheme – both of which come from a field called “color”.

    Is it possible to have a page and a repeater field using the same Options data source for a select list?

    Thanks.