I am trying to:
- I created a simple view to display a text from post type "A" with a query filter. The filter selects items in a relationship of post type "A" and "B" using "The post with ID set by the shortcode attribute".
- Some posts of the post type "A" do not have a related post of the post type "B". But a view instead of showing nothing, displays a text field of the first post "A". This creates a huge mess and it looks like a bug in my opinion.
- When I place an id of the related post into shortcode attribute the view's query filter still doesn't work.
- However, if I use other query filter options and the view doesn't have a shortcode attribute in it I don't see such issue. In this case if no related posts - view would display nothing.
Link to a page where the issue can be seen: lien caché
Hello. Thank you for contacting the Toolset support.
Can you please share problem URL and tell me for what post you do not have related post available or for what post there is no related post-relationship post available and also share what view you are using.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I have set the next reply to private which means only you and I have access to it.
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?
Les nouveaux fils créés par Minesh et associés à celui-ci sont repris ci-dessous :
With both the view that displays the Doctor first name and last name I've setup correct Query Filters:
- lien caché
- lien caché
As per our support policy we entertain only one question per ticket. This will help other users searhing on the forum as well as help us to write correct problem resolution summery. I'll split the ticket with your new question. You're welcome to mark resolve this ticket.
Thank you a lot, Minesh! I think I got what you did to fix the view. I see I used "in any relationship" instead of pointing to specific relationship in a Query filter.