Hi There - Apologies I let this one slip because of the Thanksgiving holiday and now the original ticket has been closed. Can you please reopen and continue assisting? Link below:
https://toolset.com/forums/topic/conditional-content-if-user-not-logged-in/
Thanks.
- Aaron
Hi Aaron,
Thank you for contacting us and I'd be happy to assist.
Shane is on vacation so we can continue on this new ticket.
It is important to note that, Toolset's blocks (including the conditional block) are not officially supported inside the new blocks-based WordPress widget area. Also, the conditional block doesn't work from inside reusable or grouped blocks.
Based on some tests on my website, here is a workaround that you can use:
1. You can create a new content template from WP Admin -> Toolset -> Content Templates. In this template, you can add the blocks and any content that you'd like to show in the sidebar or widget area. The conditional block will work from inside the content template too.
2. Once the content template is ready, you can load it from a "Custom HTML" block in your desired widget area, using the shortcode:
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-post-body
[wpv-post-body view_template="CT Name"]
Note: You'll replace "CT Name" with the actual name of your content template.
And for checking the user's logged-in status in the conditional statements, you can use the option "Current user ID", as shown in the attached screenshot.
( for a logged-in user, it will not be empty and for a non-logged-in visitor, it will be empty )
I hope this helps and please let me know if you need any further assistance around this.
regards,
Waqar