Hi! I'm struggling with this one.
I've a post type (mesocycle) which represents a training block for a runner. I've got 2 levels of post type beneath that one which represent parts of the training plan beneath it and have a nice view which when you look at the mesocycle page shows you the items beneath it.
I want to do the same with another post type that is a another child of the mesocycle. This is "form videos" and has a repeating field group in it. That repeating field group has a toolsets video field, a date field and a multiple line text field. If you look at one of its pages, it displays all the videos and associated text nicely.
However, I want to present these videos on the mesocycle page, but can't work out the combination of settings for it to work.
I've tried using the block editor and creating a view which selects the Form Video post related to the mesocycle, and then in that block adding a view which would iterate over the RFG, but I get an error saying I can't do nested views in the block editor.
Any tips to help out?
Hello, while you can't build nested Views in the Block Editor, you can create the inner View in the classic Views interface and place it in the Block Editor outer View's loop using a shortcode and a Classic block. The inner View should have a post relationship query filter. The shortcode syntax for placing a View is as follows:
[wpv-view name="your-nested-view-slug"]
You can enable the classic Views builder experience in Toolset > Settings > General. Let me know if you have questions about this.
Sleeping on it I managed to get it working! I think I was selecting the wrong options in the query drop down.
Got one last thing I'm trying to do though with it. Here is the structure:
Mesocyle
- Form Video View.
- - View displaying loop of RFG fields
- Place for a <link>
I want to output some text with a link which if you click takes you to the Form video page.
I can kinda get this working by using the block editor to just out put the parent of the RFGs post link, but I want to customise the text. If I get the HTML it is putting in it is outputting this shortcode:
<!-- wp:html -->
Click to view [tb-dynamic provider="toolset_relationship|form-videos|parent" post="current" source="post-title-with-link" force-string='first' ] analysis
<!-- /wp:html --></div>
Can I do something like [wpv-post-link item="@SLUG-OF-RFG.parent"] which is in https://toolset.com/forums/topic/create-a-view-that-lists-all-posts-with-repeatable-field-groups/ ?
I don't know what the slug of the RFG is. If I use [wpv-post-slug] I just get RFG out?
You should be able to do something like this:
<a href="[wpv-post-url item='@SLUG-OF-RFG.parent']">Your custom link text</a>
You can find the slug of the RFG by editing the field group. See the attached screen shot.
Ah! That was silly of me. I should have looked there. Thanks for that!