Saltar navegación

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

Este hilo está resuelto. Aquí tiene una descripción del problema y la solución.

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 hace 6 años, 7 meses. 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)

Etiquetado: 

Este tema contiene 2 respuestas, tiene 2 mensajes.

Última actualización por larryB-3 hace 6 años, 7 meses.

Asistido por: Christian Cox.

Autor
Mensajes
#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. enlace oculto

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!