Skip Navigation

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

Dieser Thread wurde gelöst. Hier ist eine Beschreibung des Problems und der Lösung.

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 vor 6 Jahren, 6 Monaten. 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.

Heute stehen keine Supporter zur Arbeit im Werkzeugsatz-Forum zur Verfügung. Sie können gern Tickets erstellen, die wir bearbeiten werden, sobald wir online sind. Vielen Dank für Ihr Verständnis.

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)

Dieses Thema enthält 2 Antworten, hat 2 Stimmen.

Zuletzt aktualisiert von larryB-3 vor 6 Jahren, 6 Monaten.

Assistiert von: Christian Cox.

Author
Artikel
#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. versteckter 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!