Dear Support
We are trying to encourage users to fill out a field in their nanny/family profiles by displaying a warning to them that a certain field is empty on their dashboard.
I tried creating a new view, which tests if a field is empty or not with a conditional. If empty, it should display a message to the user, however the message is ALWAYS being displayed whether the field is empty or not.
I thought at first this could be due to caching, so I substituted the Elementor Toolset View Widget with the Elementor Shortcode widget, and specified the view name with cached option set to off, like this:
[wpv-view name="nanny-about-me-empty-view" cached="off"]
The page the view is displayed on (my-dashboard) is also set in WP Rocket options to "Never cache this page".
Example View: "Nanny ABOUT ME empty View" (nanny-about-me-empty-view)
Page it's displayed on: "My Native Nanny Dashboard" (my-dashboard), edited with Elementor
I am also unsure of the correct placement of the query test within the Loop Editor, or whether I need a Content Template or not. There is only ever ONE nanny record or family record per user, so I don't think I need to "loop through" all the Nanny or Family records, since the Query Filter is set to "Select posts with the author the same as the current logged in user." However it may be that using a Content Template might be the correct way to go, and place the conditional in the Content Template.
I have tried this in the Loop Editor without success, with no Content Template:
[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<wpv-loop>
</wpv-loop>
<!-- wpv-loop-end -->
[wpv-conditional if="( $(wpcf-nanny-user-about-me) eq '' )"]
[wpml-string context="toolset-views-29275"]Please complete the ABOUT ME section in your <a href="<em><u>hidden link</u></em>">Nanny Profile</a>.[/wpml-string]
[/wpv-conditional]
[/wpv-items-found]
[wpv-no-items-found]
[/wpv-no-items-found]
[wpv-layout-end]
I also tried this for the Loop Editor:
[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<wpv-loop>
[wpv-post-body view_template="loop-item-in-nanny-about-me-empty-view"]
</wpv-loop>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-no-items-found]
[/wpv-no-items-found]
[wpv-layout-end]
and put the conditional in the Content Template, also with no success:
[wpv-conditional if="( $(wpcf-nanny-user-about-me) eq '' )"]
[wpml-string context="toolset-views-29275"]Please complete the ABOUT ME section in your <a href="<em><u>hidden link</u></em>">Nanny Profile</a>.[/wpml-string]
[/wpv-conditional]
So I'm unsure whether it's a cache issue, or whether the view is not working as expected. Please help us to understand why the view is not working.
Thanks and kind regards
Simon