Navigation überspringen

[Gelöst] Displaying Repeatable Field Groups with the Associated Posts in 1 Table

This support ticket is created vor 5 Jahren, 1 Monat. 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)

Dieses Thema enthält 4 Antworten, hat 2 Stimmen.

Zuletzt aktualisiert von andrewD-10 vor 5 Jahren, 1 Monat.

Assistiert von: Luo Yang.

Author
Artikel
#1413869

Tell us what you are trying to do?

There are 2 problems. This video will explain everything: versteckter Link

1st problem is when creating our repeatable field group, "Files" in a view and then using that view as a column in another view called, "projects", there is no ability to filter the Files view.

The 2nd problem, there is no way to display the repeatable field group as a column with the posts as another column without using another view. It seems that I can't display my posts in one column, and the repeatable field group in another column without creating another view as the first problem mentioned above.

Please let me know if there 1) a way to filter a view that is in a column in another view. Or 2) display repeatable field group with the post associated with the group all in one row as 2 columns.

#1414565

Hello,

Thanks for the video.
Q1) there is no ability to filter the Files view
I assume we are talking about this case:
A post type "Post", with a repeatable field groups "Files", including some custom fields
You are going to setup a post view:
- Query "Post" posts
- Filter and order by custom fields of field groups "Files".

If it is, it is not possible, since Views is using WordPress class "WP_Query" to query posts, you can only order/filter the result by custom fields of post type you are querying, in your case, it is custom fields of "Post" posts, see WordPress document:
https://developer.wordpress.org/reference/classes/wp_query/
But Toolset repeatable field groups are based on one-to-many relationships, that means the repeatable field groups "Files" is also a custom post types, so you can not achieve what you want:
- Query "Post" posts
- Filter and order by custom fields of field groups "Files".

Q2) But it is possible to display the post's title as one column and field groups "Files" information in another column.
It needs a nested view, in your case, you just need to create another post view:
- Query posts of your repeatable field groups
- Filter by the post type relationship
- In view's loop display the custom fields of repeatable field groups
See our document:
https://toolset.com/documentation/getting-started-with-toolset/creating-and-displaying-repeatable-field-groups/#displaying-repeatable-field-groups

And display above post view in column 2.

#1415127

Thank you for your help!

One last question, for Q2) wouldn't that mean I could not filter by the post title in column 2 since it is a "nested view"?

For example, if I create a view with the post title and other custom fields all as a table and then nest the view into the "Files" view with the correct query, then that would mean for the "Files" view I would only be able to filter by the files. I would not be able to filter by the other custom fields (date, checkboxes) or post title as it is nested in the files view.

#1415567

Yes, you are right, for the "Files" view you would only be able to filter by the files information(including custom fields of files.)

#1417323

Thank you!