Using S2Member PRO
I have a page that requires Level#1 or Higher access. Works great. Now I want to add an Elementor button to a Section that contains a button with a ccap of ‘ta’; and a second section with a button with a cap of ‘v’. Users with the Level#1 and a ccap of ‘ta’ or ‘v’ don’t pay anything for access to the site. That way, users with a ccap of ‘ta’ can’t see the button (which is a link to a protected page) for the users with a ccap of ‘v’ (which is also a link to a protected page). How do I code the Sections within Elementor?? I tried putting a short code into the Section, but that did not make the system ‘work’. All the Sections (and their buttons) showed up regardless of the ccap. Interesting, is that the menu on the page does work - in that a submenu of the protected content only displayed based on the ccap.
Thanks in advance for any suggestion.
Protect an Elementor Section with a ccap
In Elementor, you have to put a conditional shortcode for each block that you want to display or hide. So if you have 3 widget in one section, you have to repeat that conditional in each of them.
There is also an additional plugin called Dynamic Visibility for Elementor. It might be useful for you too.
Thanks for the information. I still can’t get it to work properly.
The good news - The menu bar only shows the page content that the user has the appropriate ccap - which works just as well. Since I have the menu bar working (it only shows the page that the person has the proper ccap), I’ll probably not put buttons on the page - and just direct the user to the menu bar. I was hoping to hide buttons, but can’t get it to work. (PS - I have the buttons working on an old site, that was not built by me nor with Elementor. That site has the conditional shortcode as text right before each button, like what you said).
Here is what I tried - On a Page, I created a section by dragging a Text Element, then I added a Shortcode Element with the following code [s2If current_user_can(access_s2member_ccap_ta)] (which was used by the current working site), then I created the Button Element within the section, and right below the Shortcode. Publish, and log out - then log in as a user with a different ccap - but the 'ta" button still shows. I must be doing something wrong - as I thought it would work.
I should have pointed out - the page with the buttons is the Login Welcome Page in s2Member.