I need to show conditionally in a bootstrap tab a text if this certain view (composer-news) has results. With single fields I would make the condition like this:
[wpv-conditional if=" NOT ( empty( $(wpcf-somefield)) ) " ]this is my link to the content[/wpv-conditional]
and I tried this, doesn't work:
[wpv-conditional if=" NOT ( empty( $(wpcf-view name ="composer-news")) ) " ]this is my link to the content[/wpv-conditional]
Hello. Thank you for contacting the Toolset support.
First of all - are you sure your view is not returning any result even space. Are you using block view or classic view? Can you please share edit page screenshot of your view?
Thank you Minesh,
This is a content template with bootstrap tabs. And we want to show the tab only if the tab has content. This certain tab contains a view (list of news, called composers-news).
The content template is done with blocks and the bootstrap tabs is a html block. Here is the code in html block:
[wpv-conditional if=" NOT ( empty( $(wpcf-view name ="composers-news")) ) " ]<li class="nav-item">Publications & news[/wpv-conditional]
At the moment the tab never shows even though there is content (I forgot to mention this!). If I delete the condition, the tab shows - but of course it shows even there is no content which is not what we want.
Then I will require problem URL and admin access details to check whats going wrong with your setup.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin) 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.
The reason why it was not working is views return the blank spaces even when no result are there. To fix that we have to add custom shortcode to trim the view's result. Can you please check now.
Composer who has some news: hidden link
and who hasn't any: hidden link
I've added the following shortcode to "Custom Code" section offered by Toolset:
=> hidden link