Hello Waqar,
Also I am struggling with the view creation process for repeatable group fields in posts even when following these tutorials and researched related forum posts for a solution:
https://toolset.com/2018/07/how-to-add-repeatable-field-groups-to-your-custom-post-types/
https://toolset.com/documentation/user-guides/filtering-views-query-by-author/
https://toolset.com/documentation/getting-started-with-toolset/creating-and-displaying-repeatable-field-groups/
https://toolset.com/forums/topic/need-to-display-repeatable-fields-from-a-related-post-type/
Yet I do not seem to get it right as I do not seem get the post relationship choice. I tried various combinations within the view including main custom post type.
Kind Regards
Dieter
Hi Dieter,
Thank you for contacting us and I'd be happy to assist.
The relationship "Family Member" group that is shown selected in your screenshot, is, in fact, the right one that you need.
( it is also the only one that exists on the website and if you're interested in learning more about post relationships other than the ones which are automatically added through repeatable field groups, you can visit: https://toolset.com/documentation/post-relationships/ )
The current query filter settings in your view "Family Member", tells the view to get all the entries from the "Family Member" repeatable group, which are linked to the parent post where this view is shown.
( screenshot: hidden link )
This means that if this view will be shown on the post "Astro Family Report - Riedel" ( hidden link ) it will bring in only one result, which is "Astro Family Report - Riedel-Gupta".
( screenshot: hidden link )
To show this view on all single "Report Member" pages, you can open the attached layout "Template for Report Members"
( hidden link ) and include a new cell to show this view.
I hope this helps and please let me know if you need any further assistance around this.
regards,
Waqar
Hello Waqar,
I understand the relationship of the repeatable field group with the custom field group is automatically established when nesting/creating them together in the custom field group.
I raised the issue as the view did not show the related family members defined via the repeatable field group. Even so I saved the views, layout templates and refreshed the page in question multiple times.
Strange enough after re-adding the view and reloading the page it worked all of sudden today on the custom post type page for the report members, probably a caching issue with my browser.
Anyway there are still some issues with displaying repeatable field group data sets:
1) When the View Family Members is added to the Layout template for the custom post type Report Members I see a comment "The Toolset Form create-new-report does not exist". Why is that as the form exists!?
2) When I add the View Family Members to the Reports page I get "No items found" for the listings of family members. Even so one exists!?
Kind Regards
Dieter
Hi Dieter,
Thanks for writing back.
> 1) When the View Family Members is added to the Layout template for the
> custom post type Report Members I see a comment "The Toolset Form
> create-new-report does not exist". Why is that as the form exists!?
- I noticed the following shortcode is used in the view "View Family Member"
( hidden link )
( screenshot: hidden link )
[cred_form form="create-new-report"]
However, the slug set for that "Create New Report" form is "create-report-form".
( hidden link )
( screenshot: hidden link )
Please update that shortcode to use the correct slug and it should work.
> 2) When I add the View Family Members to the Reports page I get
> "No items found" for the listings of family members. Even so one exists!?
- I've checked the two existing "Report Member" posts and the view seems to show the results correctly, now:
a). Astro Family Report - Riedel2
This post doesn't have any family member entry and as a result, "No items found" is showing.
( screenshot: hidden link )
b). Astro Family Report - Riedel2
This post does have a family member "Gupta", which is showing on the single post page.
( screenshot: hidden link )
regards,
Waqar
Hello Waqar,
Thanks for your reply.
1) Thanks for pointing that out this issue must have happened as I was trying to implement the edit form functionality for the repeatable field group Family Members.
2) Probably I did not explain sufficiently what I wanted to achieve. The second screenshot send was about the Reports page listing all reports via views. I am believing using views would be sufficient to achieve that. As it works for the custom post type Report Members pages but obviously something is missing.
Kind Regards
Dieter
Hi Dieter,
Please accept my apologies as I missed that the second point was related to the "Reports" page.
Our requirement for this report page and the single "Report Member" posts are different:
- On the single "Report Member" posts, we need to show all family members related to the current post where the view is shown.
For this, the query filter in view "View Family Member" works just fine.
( screenshot: hidden link )
- But in this report page, you first want to list all "Report Members" posts and then you'd also like to show all the family members attached to that specific report member.
So your first view "Member Report" is fine, but the other view "View Family Member" is not configured correctly for this.
To fix this, you can follow these steps:
1. Create a duplicate of your view "View Family Member" which is needed as it is for the single "Report Member" posts.
2. In that new duplicated view, change the query filter to "The current post in the loop", instead of "The post where this View is shown".
( screenshot: hidden link )
3. Remove the shortcode for this second view from the "Reports" page, since we want this view's output inside the loop of the first view "Member Report".
( screenshot: hidden link )
4. Place the shortcode for this new duplicated view inside the loop of the parent view "Member Report", either directly in the "Loop Editor" section ( screenshots: hidden link) or somewhere in the view's content template ( screenshot: hidden link ).
I hope this helps and here are some relevant guides on this topic:
https://toolset.com/documentation/getting-started-with-toolset/creating-and-displaying-repeatable-field-groups/#displaying-repeatable-field-groups-in-custom-order
https://toolset.com/documentation/user-guides/using-a-child-view-in-a-taxonomy-view-layout/
regards,
Waqar
My issue is resolved now. Thank you!