Skip Navigation

[Resolved] PHP custom field formatter for data in repeated field group

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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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: Asia/Kolkata (GMT+05:30)

This topic contains 5 replies, has 1 voice.

Last updated by Minesh 3 weeks, 4 days ago.

Assisted by: Minesh.

Author
Posts
#2844513

Tell us what you are trying to do?

I'm new to Toolset. I want to merge and format a list of dates inside a repeated field group.

I have a CPT Events that has a repeated field group containing Dates and Venue pairs. I would like to take the list of dates from rows of a view (ex Dec 29 2025, Dec 30 2025, Dec 31 2025, Jan 1 2026) and merge them into a text string for output that looks something like Dec 29 - 31, 2025 <br> Jan 1, 2026.

This would be simple to do if I could add custom PHP code in the loop editor, but it seem that this isn't possible? Can you point me in the right direction to be able to rewrite the results of a view? Thank you!

#2844566

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

I would like to know where exactly you want to display the repeating field group item dates? on single event post?

In addition to that - Could you please send me debug information that will help us to investigate your issue.
=> https://toolset.com/faq/provide-debug-information-faster-support/

#2844596

Thanks for your response. The information would need to be displayed both in the single event listing page and also nested in a view that is a list of events.

The current site is basically an empty testing ground for proof of concept.

#2844682

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

If you are building view in block mode, please check the following Doc:
- https://toolset.com/course-lesson/creating-and-displaying-repeatable-field-groups/#displaying-repeatable-field-groups

In block mode, nested views are not supported. For that you may need to use the legacy version of the view. You can enable the legacy mode for views using the following link:
- https://toolset.com/course-lesson/enabling-legacy-version-of-toolset-views/

Then create a view from Toolset => Views => Add new and select your desired "Repeating Field Group" from the "Content Selection" section.

From the "Query Filter" section, add the query filter for your "Repeating Field Group":
More info:
- https://toolset.com/documentation/legacy-features/views-plugin/displaying-related-child-posts/#1-creating-a-view-that-lists-the-children-of-the-parent-post

Add the desired fields to "Loop Editor" section and save your view and display it as nested view.

#2844723

Hi, I am able to generate the nested view. The issue is that I would like to take those results from that view and manually reformat those repeated results (multiple rows) entirely into one custom formatted result.

In the legacy version of Toolset Views, I can see where the loop displays each row of the results. It would be easy to do what I want to do if I could inject some PHP code there - is there a way to do that?

Thanks!

#2845316

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Either you should go for legacy views and build both views parent/child in legacy mode that will give you more control on output.