Support

Account

Home Forums Feature Requests Repeater instance field

Solving

Repeater instance field

  • Scenario:

    You have a repeater field on an options page for adding company details. Each instance of the repeater lets you select full address, contact tel, email etc. The company might have offices in AUS, UK, USA etc.

    It would be great if you could add a field type that lets you select the instances of a specified repeater. So in this new field type I would select my company details repeater as the target and then when using the field on a page / post etc I can select from a dropdown, possible multiselect, and the dropdown is populated with each instance of the selected repeater. So in this case I can select from the AUS, UK or USA repeater instances.

    In my template file I can still markup and style the new field type as usual, there’s just a different function to call so that the selected instances are pulled in only.

    Would also be great if it’s possible to reorder the selected repeater instances in the same way that you can the repeater.

    So now on the options page the company can add company details for each office they have and very easily select any of the addresses, some of the addresses, or all of the addresses, in any order, to display anywhere I have added the new field type

    ————-

    Secondly it would be awesome if there was also a tickbox within this field to allow the same select dropdown to be added to the wysiwyg editor so that a repeater instance can also be easily added anywhere in a page as a shortcode. This would making using repeaters for global information that can be used anywhere very easy and powerful.

    Would certainly be happy to pay for this one!

  • Hi @phantomdentist

    i wonder if the following article would be of interest to you:

    This article covers how to dynamically populate a select field with values from a repeater field.

    I think with a few tweaks you could customize it to contain all the data you want!

    http://www.advancedcustomfields.com/resources/tutorials/dynamically-populate-a-select-fields-choices/

  • Don’t know for sure, but possibly, thanks elliot, will give it a shot!

  • Did you make and headway with this? I would like to do something similar. Have a repeater field in the options panel, then use a shortcode to select which repeater item.

    [acf field="field_name" post_id="options" key="key_name"]

    depending on the type of the subfield might have to do:

    [acf field="field_name" post_id="options" key="key_name" subfield="sub_field_name"]

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Repeater instance field’ is closed to new replies.