# Tell us what you are trying to do?
I have custom post types for:
- Resources (Sermons, article, etc)
- Topics
- Authors
I have relationships set up to connect topics, and authors to a resource.
I would like to display a grid of 'resources' that are in relationship with a topic on that topics page. Easy enough, but I would also like to display on that grid the Author of the resource. From my research, seems like I would need to create a nested view. I got it to work using the legacy 'views' but I'm not able to use any of the styling options available in the block editor (grid styles, border radius, etc.)
# Is there any documentation that you are following?
Just googling stuff.
# Is there a similar example that we can see?
# What is the link to your site?
Only local currently. But here is a 1 minute demo showing what I'm talking about. hidden link (Turn up volume)
I believe that when nested views inside the block system is released this will probably fix that issue. However I may look for another solution if that is still a ways off.
Thanks so much!
- David Eiffert
I would also like to display on that grid the Author of the resource. From my research, seems like I would need to create a nested view.
It depends on the relationship between Authors and Resources. If it's a many-to-many relationship, you'll need a View because there can be more than one Author connected to any hypothetical Resource. If it's a one-to-many relationship, you don't need a View. The dynamic sources feature in Blocks is smart enough to know that only one Author can be related to any Resource, so you can select to display information from the related Author in a Single Field block's dynamic sources. Just drag a Single Field block into the loop of the Resource View, then use the dynamic sources feature to select the related Author post as the dynamic source for that field.
You'll always need a View to display the "many" side of a relationship, but if you're trying to display the "one" side, it's not necessary.
Another option is to use the Block Editor to design the loop template of your nested View after you create it in the legacy editor. You won't be able to design it in the context of the parent View, but you will be able to use the Block Editor to design the results of the nested View in a separate screen. See the screenshot here for the location of that feature in the legacy Editor. When you use the Loop Wizard in the Loop editor area, you will be given the option to create a template for the loop, then you can edit that template in the Block Editor.
Oh man!!!!! Wow, such a detailed and helpful response. Using the block editor to design the loop template of the nested view works perfect. Thanks Christian.
My issue is resolved now. Thank you!