Skip Navigation

[Resolved] Filtering View with shortcode

This thread is resolved. Here is a description of the problem and solution.

Problem: I would like to filter a View by the title of the current post, using a shortcode attribute.

Solution: You can embed one Views shortcode inside another Views shortcode to apply a filter.

Relevant Documentation:
https://toolset.com/documentation/user-guides/passing-arguments-to-views/

This support ticket is created 5 years, 2 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.

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.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 3 replies, has 2 voices.

Last updated by davidH-33 5 years, 2 months ago.

Assisted by: Christian Cox.

Author
Posts
#1199450

Tell us what you are trying to do?
Hi, I’m working on movie database website. I have 2 custom post types:
1) "Filmy" (=Films) - each post contains some basic information and photos about each movie - single page template has been made in Elementor Pro: hidden link

2) "Projekce filmů" (=Film screenings) - this has been created using import from xml (WP All Import Pro) - each screening as the new custom post with custom post types (one screening = one post).

I also created the View that displays informations about all screenings on single post page of custom post type “Filmy”.

Now I need to add some functionality (by customizing the View and shortcode) that will display all items from “Projekce filmů” that has same text value in custom field “performance-codeufdtext” as the text value of custom field “code-ufd” of recent post. In fact I need for each movie page to display only informations about film screenings of the recent movie. I’m using shortcode to display the view inside of Elementor single page template. For example here the view should display only screenings of movie “Složka 64”, that has text value “237” for “code-ufd” & “performance-codeufd”:
hidden link
How can I do that?

Is there any documentation that you are following?
I was trying to find the solution here but I wasn't able to find out how:
https://toolset.com/forums/topic/displaying-post-title-with-view-filtering-based-on-current-page/
I can provide you login if it' easier for you.

Is there a similar example that we can see?

What is the link to your site?
hidden link
(you can click on each movie to display single page layout with the view for screenings)

#1199519

Hi, yes please provide a login so I can take a look in wp-admin, I think it will be faster. Thanks!

#1199705
filter.jpg

Thank you, I have been recently experimenting with shortcode parameter format and view query filter and now everything already works as expected.

#1199712

My issue is resolved now. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.