Home › Forums › General Issues › Relationships between groups
Okay so let me give some context before my question. I have three groups that I currently use: Speakers, Series, and Sermons. These three groups all have overlap to a certain extent, but mainly Sermons to Speakers and Series. Whenever I make a new page that falls into the Sermons group, I have two fields that I really would like to simplify: Sermon Series, and Sermon Speaker. Currently, these field must be filled in by hand for whatever applies to them. What I would like to do is the following: pull data from the Speakers and Series group in order to populate those respective fields in a Sermons post.
Is it at all possible to create some sort of field inside one group that is a relationship to another group? So essentially, I would like, in the Sermons group, for there to be a select field titled Speakers that populates from a certain field(s) in the Speakers group. Same thing for Series.
Hopefully this makes sense. Please let me know if I need to add or clarify information. Thanks!
I’m sorry I think I’m a little bit lost in your explanation. Could you please share some screenshots of the issue and some notes on how you want it to be?
If you want to show certain fields only when a certain value is selected, I believe you can use the conditional logic feature. Just create a select field with “speakers” and “series” as the values and then set the conditional logic for the other fields. I’ve attached a screenshot for your reference.
Thanks!
James, thanks for the reply. Let me see if I can get some screenshots to explain this.
Three groups: Sermons, Series, and Speaker; Sermons has a “relationship” to series and speakers. Instead of having to manually enter every Series and Speaker, I want a sermons post to be able to pull options from posts inside Speakers and Series. For example, I am posting a sermons that is part of the “Restart” series (has it’s own page and filled out a group form for the group Series) and the speaker for that sermon is Pastor Wayne Surface (also has its own page under the group Speakers). Is there any way for my form for Sermons to look for all the posts under speakers and see “Oh, there’s a post for Pastor Wayne Surface, let’s put that as an option to choose for this sermon” and then at the series input for the sermon, “Oh, there’s a series post for ‘Restart’, let’s put that as an option for the series field.”
I really hope this makes more sense! Haha…
Here is another image to hopefully help clear the mud some more.
The best way to do it would be creating custom post type for Sermons, Series, and Speaker; and then use the Post Object field to get them. To create a custom post type, you can use a plugin like Custom Post Type UI.
You can also create a custom query for the post object field. This page should give you more idea about it: https://www.advancedcustomfields.com/resources/acf-fields-post_object-query/.
I hope this helps.
From what I can tell, I want to use custom taxonomies over custom post types. I also use Divi as my theme, and the custom post types break that. Taxonomies can be added to my already made pages though (I use pages not posts for everything). Now my problem is extracting the custom fields from a page that is added to a term (I believe that is correct) in my custom taxonomy.
Better explanation: I created (using Custom Post Type UI) a custom taxonomy for “speaker”. I went to the speakers individual pages and put in a new term for their name (1). I added a taxonomy ACF field type to my “Sermons” ACF group (2). In my post for a sermon, I select the speaker I want from the select dropdown. Now how do I use all that to call the ACF field “speaker_name” from that speakers page?
I’m afraid your request is a little bit unusual. If you want to customize it exactly like that, you would need to hire a developer to help you out with it, and I’d recommend looking for one on https://studio.envato.com/ or https://www.upwork.com/.
Also, I’m afraid you can’t show the fields from other locations. You need to edit the custom fields values from the pages that you choose on the location rules.
My suggestion is to use custom post types for Sermons, Series, and Speaker. That will make your site more manageable and won’t confuse someone else in the future.
I hope this makes sense. Thanks!
Well that is unfortunate. If I were to use the custom post types, I would have to start from the ground up with my site and a different theme, builder, etc. So unfortunately that isn’t an option. Thanks for attempting to help me though!
The topic ‘Relationships between groups’ is closed to new replies.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.