Can I filter a DIVI module placed on a page according to an access condition?
Not the content of the module, but the entire module.
In the following screenshot I want the DIVI row module to be shown in the frontend or not according to a Toolset Access condition.
Thanks for your help.
Best regards,
Francisco R.
That would be a great feature, but those modules are rendered by Divi and Toolset conditionals cannot be applied at the module level. You could possibly use CSS classes to show and hide entire modules based on some combination of CSS classes. In the module settings, there is a space to insert CSS classes (see the screenshot). You can manage a combination of CSS classes with Access Control shortcodes applied to wrapping HTML elements, but that won't prevent the module from being rendered in the page source. The only way to completely prevent the module's content from appearing in the page markup is to use inline Access Control shortcodes. If you combine those with the CSS class combination approach, you can effectively hide the content and its wrapping container.
<!-- your custom code wrapper -->
<div class="[toolset_access role='Guest' operator='allow']access-wrapper[/toolset_access]">
<!-- module content rendered by Divi -->
<div class="hide-with-access">
...your module content here
</div>
</div>
.access-wrapper .hide-with-access {
display: none;
}
I do not understand this.
Even if this is done, the content of the module is rendered in the HTML even if it is hidden with a CSS.
Right, it's still required to use the inline Access Control shortcodes in the content of the module itself to suppress the content. The CSS approach is only to remove the wrapping container(s) from display, so you don't see a blank module space in the front-end. If you'd like, I can submit your idea as a feature request to our development team. They'll consider it and I can let you know if they decide to implement Access control at the module level for Divi.
Yes. Of course. Discuss with the Toolset development team.
This feature would be really powerful for Toolset Access and would make life much easier for Toolset users.
Tell me something when you know your conclusions.
Thanks for your help Christian.
Okay sure, I've submitted the request to my 2nd tier support team, who will evaluate it and pass it along to our developers or reject it. I'll let you know what I find out. The protocol here is to close out the ticket, and I will still be able to send comments to you with updates.
Hi, at this time we have decided not to implement Access control at the Divi Module level. I will let you know if that decision changes for any reason. For now, I can share this information about our Types Access API and how it can be used by third-party plugins to restrict access:
https://toolset.com/documentation/user-guides/letting-access-control-privileges-for-other-plugins/
Implementing this API for Divi Modules would require custom code.