Support

Account

Home Forums ACF PRO Using ACF Field Entries from one post to create ACF Fields in Another Post

Solving

Using ACF Field Entries from one post to create ACF Fields in Another Post

  • I’m wondering if it is possible to create a set of fields in a post type based on the entries of another post type… probably with the repeater fields.

    The scenario is that I have one long statement that is broken into many sub-sections with a variable number of points and sub-points. I would like my client to be able to edit this themselves, so I thought making a repeater field would allow them to construct the statement.

    <ol>
    	<li>Point A</li>
    	<ol>
    		<li>Sub Point</li>
    		<li>Sub Point</li>
    		<li>Sub Point</li>
    	</ol>
    	<li>Point B</li>
    	<ol>
    		<li>Sub Point</li>
    		<li>Sub Point</li>
    	</ol>
    	<li>Point C</li>
    	<ol>
    		<li>Sub Point</li>
    		<li>Sub Point</li>
    	</ol>
    	<li>Point D</li>
    </ol>
    
    

    Then I also need to make ~10 pages with different people’s responses to the individual points. So I would like the fields on the backend of these pages to pull in the data from the main statement so that they’re in sync.

    Is this possible? Any recommendations on how to structure this efficiently?

  • treysea,

    Are you still looking for help with this?

    It is possible to construct a field group based on the selections made on another post. One would need to look at the code that is exported from a field group and how the individual fields are constructed. You can get the other post during the ‘init’ action and construct the new field group.

    The hard and important part of what you are looking for is that the field names are the same and the the field keys are both unique and do not change each time the field group is constructed. I think that having a field group that changes constantly would be extremely hard to achieve in a way that would not loose data or cause other issues.

  • Hi John,

    Thanks for your response.

    I had to move forward with just setting up a separate field group for the response posts and looping through that and the original post in the page template. Not quite as elegant as what I was hoping for, but it works and doesn’t have any of the potential issues that you warned about!

    Thanks again.

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

The topic ‘Using ACF Field Entries from one post to create ACF Fields in Another Post’ is closed to new replies.