On this page versteckter Link in the tabs below I use conditonal shortcodes to check, if there is content inside and don't display the tab if there isnt.
Now I would like to make the same thing with a view. In the last tab, there is a view that currently has no results on the post linked above. Therefore it should not display the tab at all.
Can I use wpv-conditional to check the outcome of a view or is there another attempt? The view is showing posts that are in a relationship with this post, so that could also be a way to identify if there is something to display or not.
What I do know is that if some content is empty, you dont want the tab to be displayed correct? However if a view is in the editor but the view returns No results found then you still don't want the tab to be displayed.
The problem here is that it's not possible to do this because you wouldn't be able to evaluate the view itself in the conditional code.
Okay, I see. Is there any workaround to achieve that or a little hack, like checking for fields in the view I load? I was just thinking that in the view there are several fields loaded. If the view is empty, obviously also the fields aren't there and therefore empty.
Any checking would need to be done in the view itself.
Its because we are not able to check outside the view for anything within it because the view is loaded whether or not the data is available or not if you understand where i'm getting at.
Will there be a case where the view will return empty? You could make the custom fields required so that the view will always return some result.