[Resolved] displaying related post fields in a view
This thread is resolved. Here is a description of the problem and solution.
Problem:
The issue here is that the user wanted to display the related Posts on a Parent Post. Solution:
To achieve this you will need the use of the classic editor for views. The classic view can be enable by going to Toolset -> Settings and scrolling to Editing Experience and selecting the 3rd option which gives you access to both the block and classic editor.
Now you will be doing a nested view based on 2 post views. Where you will add the Child view inside the Parent view and then add the Parent view to the respective page.
First you will create your child view in the classic editor and populate it with the relevant fields inside the Loop editor. The final step on the Product view requires that you add the Post Relationship Filter. To add the filter you will need to scroll to the query filter section. If you're not seeing this section scroll to the top of the page and on the top right you will see "Screen Options" From there you can enable the query filter section.
Then scroll to the section and click add a filter and just add the post relationship filter. See Screenshot
Ensure that you've selected "The current post in the loop"
Finally just add this view to the Parent view and it should display the related information.
This support ticket is created 4 years 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.
I want to create a page (or archive page) containing a view that loops through a custom post type (plant profiles) displaying some fields but also fields from the related products. I have set up a many-to-many relationship between plant profiles and products, but cannot seem to achieve this in a view.
The final result would be a row containing for example:
Plant profile image, name, soil type, light level; and the related product fields like product title; price, stock status.
It seems views-within-views is not supported but maybe there is a better way to do this?
Essentially if you have a view listing out Plants and you want to display the fields from a related Product then it would require nesting the views and this isn't possible to do with our Block editor for views.
To achieve this you will need the use of the classic editor for views. The classic view can be enable by going to Toolset -> Settings and scrolling to Editing Experience and selecting the 3rd option which gives you access to both the block and classic editor.
Now you will be doing a nested view based on 2 post views. Where you will add the Product view inside the Plant view and then add the Plant view to the respective page.
First you will create your product view in the classic editor and populate it with the relevant fields inside the Loop editor. The final step on the Product view requires that you add the Post Relationship Filter. To add the filter you will need to scroll to the query filter section. If you're not seeing this section scroll to the top of the page and on the top right you will see "Screen Options" From there you can enable the query filter section.
Then scroll to the section and click add a filter and just add the post relationship filter. See Screenshot
Ensure that you've selected "The current post in the loop"
Finally just add this view to the plant view and it should display the related information. If there are any issues please let me know.
Hello Shane
Thank you so much for the detailed support. I have not been able open the classical editor. Please help with that. I have looked everywhere to see what I am missing, but despite doing this - Toolset -> Settings -> Editing Experience ->block and classic editor - I cant figure out how to open the classic editor when creating a view. Please help.
Hi Shane
No there is no vies menu item in backend.
I read around a bit and saw someone had the answer that we cant run toolset bocks and toolset vies at the same time?
Would it help if i gave you site access?
Thanks for assisting.
That is true, you cant run the Blocks plugin and the Views plugin at the same time because they are essentially the same plugins just with different names.
Yes please provide me with admin access so that I can see why you're not able to activate the views/blocks classic editor.
I've enabled the private fields for your next response.
Thank you so much! I cant believe that is all it was, i must have checked that a dozen times and not seen it. Great service and support. Much appreciated.