Skip Navigation

[Resolved] Relationship Filter

This support ticket is created 6 years, 1 month ago. 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.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 7 replies, has 2 voices.

Last updated by Nigel 6 years, 1 month ago.

Assisted by: Nigel.

Author
Posts
#1155328
Bildschirmfoto 2018-11-29 um 10.52.12.png

On this page see link

hidden link

I have holiday homes and accommodations. The accommodations are displayed on the website using Relationships One to Many. That's okay so far.
Now I have created a price table with repeatable field groups in the accommodations. The price table is also displayed. Unfortunately, I can not find out which filter I have to set, so that only the prices are displayed, which also belong to the property. I have tried all the filters he shows me either all prices, from all accommodations or none at all. Sorry, this item is not available. Unfortunately, this filter does not work "Select items from the price of accommodation group that are related to the post where this view is shown." Can you help me with that?

#1155440

Nigel
Supporter

Languages: English (English ) Spanish (Español )

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

Hi there

Can you clarify the relationship (which is one, which is many)?

The link you shared is for a single project post; would this be what you mean by a holiday home?

So it looks like accommodations are a child post of projects (like rooms in a hotel).

The prices fields are from a repeatable field group which belongs to the accommodation posts, is that right?

So you would be looking at a project page.

You add a View to list the child accommodations.

I need to understand where the price fields are coming from, and if the above sounds correct.

#1155471

Thanks for your help
yes it is right Accommodations are children of projects.
In the Relationship Projects = one and Accommodations Many
The other things have interpreted you correctly

#1155473

I have included the price fields under Accommodation with a Repeatable field for date (from to) and price for (day and month) Now I want to show on the project page only the prices that were created in the accommodation

#1155531

Nigel
Supporter

Languages: English (English ) Spanish (Español )

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

Technically the implementation of repeatable field groups is via child posts (for every group instance there is a post created which acts as the container for that set of fields).

So your relationships are actually like this:

projects
     \
      \
  accommodations
        \
         \
      price RFG

You display RFGs using a View, with a Query Filter to set the post the RFGs belong to.

From the above it should be clear that the context for the View needs to be the accommodation.

So in your template to display a project, you insert a View to list the accommodations belonging to that project. You should then nest the View to display the pricing RFGs inside the loop of the View that lists the accommodations.

In that case the Query Filter can point to the post where the View is shown.

#1155551

Sorry but I do not understand a word
How do you mean nesting the query?
Is not there an easier solution for this?
Is there any way that someone can help me against payment.

#1155552

Do you know someone who can help me with this? It just takes me too long

#1155577

Nigel
Supporter

Languages: English (English ) Spanish (Español )

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

What I meant was that you must have a View which lists the accommodations that belong to the project.

In the Loop Output section of this View you output various content about the accommodations. You should also insert the View to display the prices in this same place.

It sounds like you did most of the work already, but we have a section with Toolset Contractors where you can post for paid help: https://toolset.com/contractors/