Skip Navigation

[Resolved] Nested view filtered by parent custmm field

This support ticket is created 6 years, 3 months 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 2 replies, has 2 voices.

Last updated by minanA 6 years, 3 months ago.

Assisted by: Nigel.

Author
Posts
#1142382
Edit View ‹ SEMESTA — WordPress (1).png

We have 2 post types:
#1 "Jadwal" contains custom field "Hari"
#2 "Jurnal" contains custom field "Kelas",

We will display "Jadwal" inserted with list of any post of "jurnal" which is Kelas = Hari.

We tried using URL parameter (screedshot) but it didn't work.

Any advice please ...

#1142941

Nigel
Supporter

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

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

Hi there

You need to pass the value as a shortcode attribute (see https://toolset.com/documentation/user-guides/passing-arguments-to-views/).

So, you have a View to list Jurnal posts which includes a Query Filter for the Kelas field where the value comes from a shortcode attribute.

Then, in the template for Jadwal posts you insert this View using the wpv-view shortcode, and you add the shortcode attribute that the View is expecting, with the value provided by the Hari field (you can use the Fields and Views button to insert the Hari field as the shortcode attribute value).

Please try that, and if you get stuck I'll give more details.

#1143071
Edit view.png
[wpv-view name="list-of-jurnal" sameashari="[types field='kelas'][/types]"]

Thank you, Nigel ... again. (y)