I have a view like this:
[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<div class="award-badges tablet-right">
<wpv-loop>
[wpv-post-body view_template="Loop item in View for Award Badges"]
</wpv-loop>
</div>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-no-items-found]
[/wpv-no-items-found]
[wpv-layout-end]
When no results, is this the correct way to leave output blank?
It does work, but still generates an empty <div id="wpv-view-layout......>. Is there a way to remove that empty div altogether?
Shane
Supporter
Languages:
English (English )
Timezone:
America/Jamaica (GMT-05:00)
Hello,
Thank you for contacting our support forum.
Could you try the solution here and let me know if it helps.
https://toolset.com/forums/topic/views-clean-outpoot-for-wpv-no-items-found/#post-539552
Thanks,
Shane
No. Since I'm mostly concerned about what happens if there are no results and that part of the view comes after the loop comments, hiding the loop comments does nothing. I still get this empty div.
<div id="wpv-view-layout-798-TCPID485" class="js-wpv-view-layout js-wpv-layout-responsive js-wpv-view-layout-798-TCPID485" data-viewnumber="798-TCPID485" data-pagination="{"id":"798","base_permalink":"/notable-cases/attorney-name/?wpv_view_count=798-TCPID485&wpv_paged=WPV_PAGE_NUM","query":"normal","type":"disabled","effect":"fade","duration":"500","speed":"5","pause_on_hover":"disabled","stop_rollover":"false","cache_pages":"enabled","preload_images":"enabled","preload_pages":"enabled","preload_reach":"1","spinner":"builtin","spinner_image":"<em><u>hidden link</u></em>","callback_next":"","manage_history":"enabled","has_controls_in_form":"disabled","infinite_tolerance":"0","max_pages":0,"page":1,"loop":{"type":"","name":"","data":[],"id":0}}" data-permalink="/notable-cases/attorney-name/?wpv_view_count=798-TCPID485">
</div>
Shane
Supporter
Languages:
English (English )
Timezone:
America/Jamaica (GMT-05:00)
Hello,
Did you try the function in this exact reply ?
https://toolset.com/forums/topic/views-clean-outpoot-for-wpv-no-items-found/#post-539552
Using the hideit shortcode?
Please let me know.
Thanks,
Shane
Shane
Supporter
Languages:
English (English )
Timezone:
America/Jamaica (GMT-05:00)
Hello,
I just tried the solution and it worked for me.
Ensure thats its wrapped around the items that are highlighted below.
[hide-it]
[wpv-layout-start]
[/hide-it]
[wpv-items-found]
<!-- wpv-loop-start -->
<ul class="wpv-loop js-wpv-loop">
<wpv-loop>
<li>[wpv-post-body view_template="Loop item in Test Hide It"]</li>
</wpv-loop>
</ul>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-no-items-found]
<strong>[wpml-string context="wpv-views"]No items found[/wpml-string]</strong>
[/wpv-no-items-found]
[hide-it]
[wpv-layout-end]
[/hide-it]
Thanks,
Shane
Okay, I'll try that. In the earlier ticket the [hideit] shortcodes were surrounding the <!-- wpv-loop-start --> comments.