Skip Navigation

[Resolved] Repeatable field inside search view

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

Problem: I would like to display a list of repeatable field groups (RFG) inside the results of a custom search View.

Solution: Use the legacy Views editor to build the nested View, then insert it in the loop of the block editor View using a shortcode.

0% of people find this useful.

This support ticket is created 3 years, 2 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)

Author
Posts
#1942109

Tell us what you are trying to do?
I created a custom post-type called 'manuals' inside manuals I created a repeatable field. When a user search through the manuals (using a view) I want to display the name of the manual and under that all the repeatable fields that were added to that specific manual. The problem is that I cannot find a way to display the repeatable fields when already inside a view.

Is there any documentation that you are following?
I have used this https://toolset.com/course-lesson/creating-and-displaying-repeatable-field-groups/ but can't find a way to make it work when already inside a view.

Is there a similar example that we can see?
Not that I can find.

What is the link to your site?
hidden link

#1942523

Hello, it sounds like you want to display a list of repeatable field groups (RFGs) nested inside the loop of a View of the parent post type. If that is correct, then the problem here is that the Block Editor does not currently support nested View creation. You can design one View in the Block Editor, but you cannot build another View inside the loop of the original View.

The best way to solve this problem is to use the legacy Views editor to build the nested RFG View, then insert the RFG inside the loop of the original View using a shortcode.

To activate the legacy Views editor, you must go to wp-admin > Toolset > Settings > General tab and find the Editing Experience setting. Choose the option that enables both the Block Editor and the legacy editor, save the settings, and refresh the page. Now you should find a Views menu item under the main Toolset menu, so you can go to Toolset > Views and click "Add New" to create a new View outside the Block Editor. In the first popup you should choose "Display all results" and give the View a name.

In the main View editor screen, you should select this RFG in the Content Selection panel. Then scroll down to the Query Filter section and click "Add a filter". In the popup, choose a "Post relationship or repeatable field groups owner" filter type. Then you will be able to choose some settings for the filter. You should set it to "Select items from your RFG group as related items of...", then choose "the current post in the loop", since we will be displaying this View inside the loop of a parent post type View.

Then scroll down and click "Loop Wizard" above the Loop Editor panel. You can choose from different display types here, like an ordered or unordered list, and you can insert different fields from the RFG to display in the looped RFG results. The wizard will generate the appropriate shortcodes for you automatically. You could also use the Block Editor to design the loop template if you prefer.

Once you have set up the loop, save the View and copy the View slug at the top of the View editor page. Then return to the View of the parent post type in the Block Editor. Now you can insert the RFG View in the loop of the parent post View using a paragraph block and a shortcode like this:

[wpv-view name="paste-your-view-slug-here"]

This will nest the RFG View inside the parent View.

Let me know if you run into problems with this approach, it's a bit more complicated than the Block Editor if you're not familiar with HTML. I can give more direct guidance if needed.

#1948759

My issue is resolved now. Thank you!

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