Skip Navigation

[Resolved] Need View with Repeatable Field Group that belongs to a Related Post

This support ticket is created 6 years, 4 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 3 replies, has 2 voices.

Last updated by larryB-3 6 years, 4 months ago.

Assisted by: Beda.

Author
Posts
#923235
Screen Shot 2018-07-10 at 8.03.52 PM.jpg
Screen Shot 2018-07-10 at 8.04.04 PM.jpg
Screen Shot 2018-07-10 at 8.04.18 PM.jpg
Screen Shot 2018-07-10 at 8.01.03 PM.jpg

Tell us what you are trying to do? I have a CPT called Homeowners. Within Homeowners is a repeated field group called Phone Numbers. I have a CPT called Properties.

I have built a view that queries properties and shows the property record, row-by-row, and for each row the name of the first record listed as a homeowner. Within this view I've successfully pulled the Title, First Name and Last Name fields of the Homeowner that is tied to the Property.

What I can't get is the first phone number listed in the repeatable field group for Phone Numbers. Note that column 14, which is labeled Homeowner #1 Phone #1 just returns "No phone numbers found" even though some of the records have a phone number associated with them.

I created a view called "Homeowner #1 Data Export - Phone #1" that I have inserted in to the primary display view which I call "All Properties Export for Mail Merge". Once I figure out how to get phone #1, I will then duplicate and skip a record to get phone #2. The first 2 phone numbers for each homeowner is all I care about even though they may have more in the database.

Here's the results of the view I created: hidden link

#923404

That's strange, It seems to be set up all correctly but I believe there is a misunderstanding here, as you try to display a field of a parent, not a chid in this case, if I am not wrong.

Let me see this on the backend, or, can you exactly elaborate the structure?

1. What relation is Homeowner to Property (one to many, many to many)
2. You plan to display a single Property post with a list of records? What are those records?
==> To call related post fields, you can use the item / id attribute of each of our shortcodes. However for RFG's, you would use a View that returns those Repeating Field Groups belonging to the Post where this View is shown.
3. In case this List of RFG should display in a List of related posts, then you would choose the setting you have now (/post in loop).

Please can you update me with the details?

#923941

Great, I edited hidden link to query RFG "Phone Numbers"
Since this RFG belongs to "Homeowners", and you plan to display the RGF of the current Post which is in that List (which is a related post to the main listed properties), I have set a Query Filter as this:
"Select items from the Phone Numbers group that are a related to the current post in the loop."
Then, I inserted the "Phone" into he template which belongs to the group

So far all good but you inserted the View in the loop of the Properties View, not in a Loop of Homeowner, so nothing can be displayed:

<td>[wpv-view name="homeowner-1-data-export-phone-1"]</td>

This needs to be in a view that queries Homeowners.

Then, it'll display the numbers.

The Homeowners View instead should be inserted to the Properties View and then this will work.

Can you reorganize your structure to so to add a view that returns first the right Homeowner as you do for example in hidden link?

If you insert the hidden link view there for example, it'll return some numbers.

I left that to you to do, as I do not want to alter the front end

#924130

Thanks so much Beda!! You rock!! I was able to take your direction and run with it. Now I just need to patiently wait till you all release and update allow a view to be filtered by an Intermediary Post Type field value so I can just get "Current Homeowners" on my list an "Exclude Previous Homeowners".