Home›Toolset Professional Support›[Resolved] Split: Query filter with in a view doesn’t work properly if there is no related post – display view conditinoally
[Resolved] Split: Query filter with in a view doesn’t work properly if there is no related post – display view conditinoally
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.
Hi Minesh. Thank you! It is working properly now! May I ask what did you do so I could use it in future development?
Also, I am trying to use the view with a shortcode in conditional output. The idea is to check is there are no doctor posts connected to report request post, so I could display a data conditionally.
However, it doesn't work.
Here is example
[wpv-conditional if="( "[wpv-view name='display-doctors-first-name-related-to-report-request' relatedreportrequest="[wpv-post-id item='@report-request-report-order-estimation.parent']"]" eq '' )"]
YEY
[/wpv-conditional]
I tried to put a shortcode view in PHP snippet shortcode but it doesn't work either (I get an error).
add_shortcode('doctors-first-name-related-to-report-request', function(){
return wpv_do_shortcode('[wpv-view name="display-doctors-first-name-related-to-report-request" relatedreportrequest="[wpv-post-id item='@report-request-report-order-estimation.parent']"]');
});
Do you think it is possible at all to use such view in conditional output?
Hi Minesh.
Here is a URL of estimate that you had a chance to look at in another ticket: hidden link
Currently, as it should be the Doctor name is not getting displayed since there is no connected Doctor post. However in such cases I would like to display a Health Organization name instead which post would normally be connected if there is no doctor post.
That's why I was going to check whether doctor post is connected, and if not - display health organization info instead