[Resolved] display the first item group of repeatable items in a view

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

Problem: How to display the first item of a Repeatable Field Group on each post?

Solution: You can create a View that displays your RFG (Repeatable Field Group) items Add a query filter so it displays the RFG items that belong to the post where you'll insert this view.

Then ensure the View Ordering option is set to orderby toolset-post-sortorder field, in an ASC order. In the Limit and Offset settings, set to display 1 item, skip 0 items.

This will display the first RFG item for the post where you'll insert this View. If you drag and drop the RFGs on the post in a new position this will change the View output, and set a new RFG as the "first", and only output item.

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.

This topic contains 6 replies, has 2 voices.

Last updated by Franco Calcagni 2 months, 3 weeks ago.

Assigned support staff: Beda.

Author
Posts
#1581511

We have a repeatable group fields and we need to display the first item only in a view

#1582039

You can create a View that displays your RFG (Repeatable Field Group) items
Add a query filter so it displays the RFG items that belong to the post where you'll insert this view.

Then ensure the View Ordering option is set to orderby toolset-post-sortorder field, in an ASC order.
In the Limit and Offset settings, set to display 1 item, skip 0 items.

This will display the first RFG item for the post where you'll insert this View.
If you drag and drop the RFGs on the post in a new position this will change the View output, and set a new RFG as the "first", and only output item.

I hope this helps!

#1582067

Hi Beda, thanks for your reply, could you please send me a screenshot of the view settings so to configure it correctly?
Thanks in advance
If I want to display all repeating group fields belonging to that post what changes shall I do in the view configuration?
Franco

#1582079

The View settings look like this

#1583751

Hi Beda, I created a view with the settings you listed and placed it in a content template but I get the result "no items found"
I enclose the 2 screenshots, what could be the problem?

In addition, if I have to place this view within a slide in the slideshow of the homepage, how can I achieve the result since the post is not directly the post where the view is shown but another page?

#1584877

Then you have either no Repeatable Field Groups on that Post, or maybe imported them with a code that does not import the Toolset Sort Order Field, or created them with Toolset Forms, which also does not include that field (by mistake, there are plans to fix that)

Can you ensure the post you tested has indeed some RFG of that type and then if it still doesn't work, save that post once again to test?

Related to your addon question I suggest opening a new ticket, I am not sure this works. It might be possible (depending on your setup) with some ShortCode attributes.

#1585017

My issue is resolved now. Thank you!