Skip Navigation

[Resolved] Displaying a repeatable field group connected via a post relationship

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

Problem:

Display items of repeatable field groups.

Solution:

You can follow our document to setup a post view and display items of repeatable field groups.

Relevant Documentation:

https://toolset.com/documentation/getting-started-with-toolset/creating-and-displaying-repeatable-field-groups/#displaying-repeatable-field-groups

0% of people find this useful.

This support ticket is created 5 years, 4 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: Asia/Hong_Kong (GMT+08:00)

This topic contains 3 replies, has 2 voices.

Last updated by josephC-5 5 years, 4 months ago.

Assisted by: Luo Yang.

Author
Posts
#1325723

Hi there,

I'm working on a website for an art gallery. It has a couple of custom post types, such as Artist and Artwork. The two CPTs are connected via a one-to-many relationship. The Artwork post type also contains a repeatable field group with an image name, artwork title, artwork dimensions, artwork year, etc. (This architecture was suggested by Luo in https://toolset.com/forums/topic/creating-a-gallery-of-galleries/ and Shane in and https://toolset.com/forums/topic/extracting-metadata-from-a-media-file-and-outputting-it/.)

On the front-end template for the display of a single artist, I'm trying to create a grid of thumbnail images, but I'm not sure what the correct Query Filter settings ought to be in the view I'm creating. (I tried a couple of different things, but they didn't work.) To make matters more complex, I also need to display only the *first* group in the set of repeatable field groups. For example, if an Artwork post has two repeatable field groups, only the first should be output on this page.

Can y'all offer some guidance?

Please let me know if anything is unclear or you require additional information. Thank you!

Saul

#1325741
rfg-1.JPG

Hello,

The repeatable field groups are based on one-to-many relationship, so each item of repeatable field groups is also a post.

For example, your repeatable field groups is using name "artwork information", you can try these:
1) Create a post view:
- Query posts of repeatable field groups "artwork information"
- Filter the by post type relationship
Select items from the "artwork information" group that are related to the Post where this View is shown.
- Order by "Field - toolset-post-sortorder" ascending
- display 1 item
See screenshot: rfg-1.JPG

2) In the "front-end template for the display of a single artist", display above post view

And test again.

More help:
https://toolset.com/documentation/getting-started-with-toolset/creating-and-displaying-repeatable-field-groups/#displaying-repeatable-field-groups
section "Displaying Repeatable Field Groups"

#1326157

Luo,

Thanks for your response. The screenshot is very clear.

I tried configuring my own setup per your instructions, but the webpage displayed the dreaded "no items found," which makes me think something's misconfigured in the view.

Should I share credentials to my development environment?

Saul

#1326201

Luo,

I think I found a thread on the support forum that describes, and solves, my exact problem:

https://toolset.com/forums/topic/need-to-display-repeatable-fields-from-a-related-post-type/

I'm all set for now.

Thanks!

Saul