Hi - I chatted with Shane yesterday about setting up a conditional that is true when either a view has results or a field has content. I thought I had it working, but today I realized it's only checking for the field content, not the view results.
This is what I've got in the template:
[wpv-conditional if="( $(event-feed) ne '' )" OR ([wpv-view name="page-common-tasks"] ne '')]
<div class="page-sidebar">
[/wpv-conditional]
[wpv-view name="page-common-tasks"]
[types field='event-feed'][/types]
[wpv-conditional if="( $(event-feed) ne '' )" OR ([wpv-view name="page-common-tasks"] ne '')]
</div>
[/wpv-conditional]
The view is set up so that when there are no results, it prints nothing.
On a page with just an event feed, I get the div with the events feed inside it. On a page with common tasks and an event feed, I get both sections with the div wrapping them. But on a page with only common tasks and no event feed, I'm not getting the div, just the view output.
What do I need to do differently to get this working?
Could you add debug='true' to your code so that i can see what is being displayed in the conditional?
Example
[wpv-conditional if="( $(event-feed) ne '' )" OR ([wpv-view name="page-common-tasks"] ne '') debug='true']
<div class="page-sidebar">
[/wpv-conditional]
The second half of the conditional still isn't working, but I figured out a way to style the page so that it doesn't matter if there's an empty div present (so I'm just including the div tags with no conditional around them). Unless something goes wrong with that down the road, that solves the issue I was trying to solve.