I am trying to:
Conditionally display content based on whether a user has submitted a post of the "Basic Gift" post type.
The end goal is to have a conditional block that displays a Forminator post creation form (of the "Basic Gift" post type) if the user has not already created a post of that type. I created a conditional block containing the Forminator form and a toolset view. When I couldn't get the conditional block to work correctly, I took the Forminator form out and replaced it with paragraph text to assist with debugging the issue
The View I'm using is called "Basic Gift Vw". It displays posts of the "Basic Gifts" post type, where the author is the same as the as the current logged-in user. Following the advice from a similar Toolset issue thread, I created the following code in the Loop Editor:
[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<wpv-loop>
[wpv-items-count]
</wpv-loop>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-no-items-found]
[wpv-found-count]
[/wpv-no-items-found]
[wpv-layout-end]
When this View is displayed in a page, it displays the number of Basic Gift posts a user has created.
Then, in the page where this View is used, I created a Conditional block with the following logic:
NOT ( ( '[wpv-items-count ]' gte '1' ) )
Inside of this block is the "Basic Gift Vw" and paragraph text that says: "This SHOULD show if the number of items displayed in the view loop is 0. This should NOT show if the number of items displayed in the view loop is > 0."
Theoretically, on the front end this should show the number of posts a user has created (0), followed by the aforementioned text, IF there are no posts found in the view. Otherwise, nothing should be displayed.
Instead, the number of posts and the paragraph text is displaying, regardless of if the current user has 0 or 1 Basic Gift posts.
Attempt 2:
I changed the Conditional logic to: ( ( '[wpv-items-count ]' gte '1' ) )
This results in the block NOT displaying, regardless of if the current user has 0 or 1 Basic Gift posts.
Attempt 3:
I changed the Conditional logic to: NOT ( ( '[wpv-items-count ]' gt '0' ) )
This results in the block displaying, regardless of if the current user has 0 or 1 Basic Gift posts.
Additional Attempts:
I tried adding the condition: Views Shortcode: Archive Title = Static Value: "basic-gift-vw"
( ( '[wpv-items-count ]' lt '1' ) AND ( '[wpv-archive-title ]' eq 'basic-gift-vw' ) )
Which did not work either.
*Note: I am NOT a programmer, which is why I bought Toolset for my website. That being said, I can follow basic and clear instructions to copy/paste code, insert the proper slugs, etc.
Link to a page where the issue can be seen:
hidden link
I expected to see:
Content displayed depending on if a user has 0 Basic Gift posts or >0 Basic Gift Posts.
Instead, I got:
Content displays regardless of if a user has 0 Basic Gift posts or >0 Basic Gift Posts.