Problem:
The user has a one-to-many relationship between two CPTs, he would like to show the siblings of the child CPT on a single CPT post with Blocks.
Solution:
We can do this, but we need an unassigned Content Template to keep the context of the parent CPT.
1. Create an unassigned Content Template, this template must not be assigned to any post type.
2. Add a new View Block to show the siblings.
2.1. Choose the post type "Section/Walk", and add a relationship Query Filter for the parent "Trail/law" according to "the current post in the loop".
2.2. Add the field that you want to show for the sibling (title, etc.)
3. Create a Content Template for the child post type "Section/Walk".
3.1. Create a Classic Block.
3.2. Use the "Fields & Views" button to insert the unassigned Content Template that you have created on 1.
3.3. In the "Post selection" tab choose the "A post related to the current post, set by a Types relationship" and your relationship. Check this image http://prntscr.com/rmp87q
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: Africa/Casablanca (GMT+01:00)
This topic contains 3 replies, has 2 voices.
Last updated by 4 years, 9 months ago.
Assisted by: Jamal.