Skip Navigation

[Resolved] View all Repeater Fields of all CPT Posts

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

Problem:
The user would like to create a view, in the blocks editor, to display all the items from an Repeatable Field Group(RFG) field, from all the parent posts.

Solution:
This use case is not supported for blocks based views. Either, create the view with the classic editor, or use a one-to-many relationship instead of an RFG.

This support ticket is created 2 years, 5 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
9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - - 9:00 – 13:00
14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 - - 14:00 – 18:00

Supporter timezone: Africa/Casablanca (GMT+01:00)

This topic contains 9 replies, has 2 voices.

Last updated by Jamal 2 years, 5 months ago.

Assisted by: Jamal.

Author
Posts
#2209561

Hi!

> what you are trying to do?

I have a Custom Post Type EVENTS with a Repeater Field DATES. It contains Date Fields.

I have a singe page EVENTSOVERVIEW. I want it to show all DATES of all EVENTS in Date Order. Not ordered by EVENT.

What is the best way to achieve this? A View for EVENTS posts probably does not dig into the DATES. A nested view for DATES is not possible and presumably wouldn't provide the desired sort order.

Regards
Thomas

#2209915

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Hello and thank you for contacting Toolset support.

You will need a view of the repeatable field group(RFG). RFGs fields are basically a hidden custom post type, with a hidden one-to-many relationship to its parent post(in this case Events).

The view can be ordered by the date field. And you can display information from the parent event post in each RFG item. Check this article and let me know if you have any further questions.
https://toolset.com/course-lesson/creating-and-displaying-repeatable-field-groups/#displaying-repeatable-field-groups

#2210041

Hi!

Thanks for your reply. The method works fine for the Single EVENT Posts. The documentation says: "Edit the Content Template for single posts of the related post type."

This is not what I need. In my case, I need the Repeater data of all EVENTS in one specific PAGE Post. I need all Repeater Fields of all EVENTS Posts in one overview Page Post named EVENTSOVERVIEW.

As the Repeater Fields already are hidden CPTs, there should be a way to query them all. But I don't know how.

Regards
Thomas

#2210059

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Hello Thomas, please do not focus on the content template parts of the documentation article. Focus only on the view part. Create a view, choose the repeatable field group in the content selection section, then save the view.

If you are unsure how to do it, allow me temporary access to your website and I'll prepare an example for you. Your next reply will be private to let you share credentials safely. ** Make a database backup before sharing credentials. **

#2210967

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Thank you for the credentials. For some reason, the Repeatable Field Group is not available in a view block. Either in the setup or after hidden link
As you may see on this image, the RFGs should appear when creating the view hidden link

I can't tell what has caused that. I need to take a copy of your website for further debugging to figure it out.

In the meantime, I have activated the legacy editor, in Toolset->Settings->General->Editing Experience, to check the existing views(Toolset->Views).
I created a view using the legacy editor, you can edit it here hidden link
While creating the view, I generated a content template to use inside the view's loop. You can edit it here hidden link

We have had a similar case to this before, and we fixed it by removing an entry from the database. I need to take a copy of your website to find out more about it. Is it fine with you if I install a plugin and take the copy?

#2211047

Feel free, the whole page is just for Toolset tests.

#2211733

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

I took a copy of your website and worked on it locally. Unfortunately, I could not resolve the issue. Let me approach our 2nd Tier for assistance on this issue and get back to you asap.

#2212945

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

I have discussed this with our 2nd Tier team and they explained that this is not supported within the blocks editor. We cannot display all of an RFG items from all parent posts in a blocks based view. We can only display the items from a parent post. And that can only be possible within that post type content template.

This being said, there two options to achieve what you want:
- Split the RFG into an additional custom post type, linked with a one-to-many relationship to the parent post.
- Or to create the view with the legacy editor.

I hope this helps. Let me know if you have any questions.

#2215641

Thanks a lot. I already solved the issue the way you mentioned. Split into two CPTs with Relationship. This works.

#2215819

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Awesome, and thank you for your feedback. I'll set this ticket as resolved. Feel free to open a new ticket for any question or issue.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.