Skip Navigation

[Resolved] How to create view as a table for repeating fields like phone numbers and email

This thread is resolved. Here is a description of the problem and solution.

Problem: I have a custom post type "Renter" that includes two Repeating Field Groups (RFGs) "Phone numbers" and "Email addresses". I would like to create a table View that shows all Renters and includes all of their phone numbers and emails as well.

Solution:
Use 3 nested Views. Create 1 View for Renters that builds the main table. Each row in the table represents 1 Renter. Create 1 View for Phone Numbers repeating field group (RFG), and 1 View for Email addresses RFG. You do not need to create a whole table for each repeating field group.

Set up your View of Phone Number RFG with a post relationship filter, set by the current post in the loop (which in your case will be Renter from View 1). Use the Loop Wizard to create an unordered list style View that outputs each phone number item. Insert the View of Phone Number RFGs in the View of Renters Loop Output, nesting the View shortcode in the correct table cell.

Set up your View of Email RFG the same way, with a post relationship filter set by the current post in the loop.

Relevant Documentation:
https://toolset.com/documentation/getting-started-with-toolset/creating-and-displaying-repeatable-field-groups/
https://toolset.com/documentation/user-guides/view-layouts-101/
https://toolset.com/documentation/user-guides/using-a-child-view-in-a-taxonomy-view-layout/

This support ticket is created 6 years, 6 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 2 replies, has 2 voices.

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

Assisted by: Christian Cox.

Author
Posts
#880925
Screen Shot 2018-05-13 at 12.12.06 PM.jpg
Screen Shot 2018-05-13 at 12.12.13 PM.jpg
Screen Shot 2018-05-13 at 12.12.22 PM.jpg

Tell us what you are trying to do? On this page, I have a table view, that shows me all of my fields for a CPT. hidden link

This CPT has 2 repeating fields, phone numbers and email addresses. When I have these shown in a table view, it creates separate line items for them instead of them being shown with their primary post.

Is there any documentation that you are following?

Is there a similar example that we can see?

What is the link to your site?

#881400

Hi, I think I would approach this a bit differently. I would create 1 View for Renters that builds the main table. Each row in the table represents 1 Renter. I would also create 1 View for Phone Numbers repeating field group (RFG), and 1 View for Email addresses RFG. You don't need to create a whole table for each repeating field group.

Set up your View of Phone Number RFG with a post relationship filter, set by the current post in the loop (which in your case will be Renter from View 1). Use the Loop Wizard to create an unordered list style View that outputs each phone number item. Insert the View of Phone Number RFGs in the View of Renters Loop Output, nesting the View shortcode in the correct table cell.

Set up your View of Email RFG the same way, with a post relationship filter set by the current post in the loop.

Let me know if you have questions or if I've misunderstood your request.

#883254

Brilliant answer! Thanks so much!