Skip Navigation

[Geschlossen] How to show Child posts from another relationship?

This support ticket is created vor 2 Jahre, 9 Monate. 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

This topic contains 1 Antwort, has 2 Stimmen.

Last updated by Nigel vor 2 Jahre, 9 Monate.

Author
Artikel
#2098695

Tell us what you are trying to do?
I want to show Child posts from another relationship.

Here is the relationship structure.
CAREERS (Parent) - OFFERS (Child)
CAREERS (Parent) - REVIEWS (Child)

In REVIEWS, I want to show OFFERS which share the same CAREERS parent.

Note: I'm using the built-in Toolset relationship.

Any help would be much appreciated!

Stan

#2099141

Nigel
Supporter

Languages: Englisch (English ) Spanisch (Español )

Timezone: Europe/London (GMT+00:00)

Hi Stan

The solution requires that you create a View to list offers that are children of the current career.

The problem is that your starting point isn't a career post, it is a review post. So you have to set the context to the parent career as the starting point for this View.

You can do that by creating a Content Template and adding the View to that template and acting as if that template were assigned to career posts, so you can add a relationship Query Filter to show child offers of the current career.

You then insert this Content Template into the template for reviews and switch its context with the item attribute (e.g. item="@career-review.parent").

If you are using the Blocks editor, the Content Template block doesn't have a way to switch context in the same way, you will instead have to insert the template using a shortcode so that you can add the same item attribute.

Das Thema „[Geschlossen] How to show Child posts from another relationship?“ ist für neue Antworten geschlossen.