Skip Navigation

[Resolved] display siblings posts

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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 2 replies, has 1 voice.

Last updated by Minesh 1 week, 3 days ago.

Assisted by: Minesh.

Author
Posts
#2793143

3 CPT's:
MOVIES, FOLDERS, DISCS

2 relationships :
1-to-Many relationship 'movie-data-folder': MOVIE (parent)->FOLDERS (childs).
another 1-to-Many relationship: DISC (parent)->FOLDERS (childs).

So FOLDERS have 2 parents.

For example,
- data of FOLDER_A (parent=Movie_01) are on DISC_01
- data of FOLDER_B (parent=Movie_01) are on DISC_02
- data of FOLDER_C (parent=Movie_01) are on DISC_03
- data of FOLDER_D (parent=Movie_02) are on DISC_01

When I display the FOLDER_B post, I'd like to display the list of the other folders related to the MOVIE parent of FOLDER_B, so the brothers/siblings of FOLDER_B (in this case the Folders B and C).

The idea is to create a View for this use only, right ?
So I create a View ('sibling-folders') to display the list of FOLDERS with a query: "Post Parent" -> Post with ID set by the shortcode attribute "wpvchildof".

and here start the fog... in the field "wpvchildof" which is automatically filled with "wpvchildof", is there anything else to add ?

Where should I indicate the relationship MOVIE (parent)->FOLDERS ?
How to display this view in the FOLDER content template ?

For the moment I add a HTML block with:

<div>
[wpv-view name="sibling-folders" wpvprchildof="[wpv-post-id item="@movie-data-folder.parent"]"]
</div>

But it display all the folders and not only the related ones...

#2793144

I'm working offline so if you need to access the site I have to send you a backup. 😉

#2793147

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - you are using wrong filter. You will have to use the post relationship filter. You will have to select the option "add a new Query Filter and select the Post relationship or repeatable field groups owner" query filter and filter with "The post with ID set by shortcode attribute".

More info:
- https://toolset.com/documentation/legacy-features/views-plugin/displaying-related-child-posts/#1-creating-a-view-that-lists-the-children-of-the-parent-post