Inicio › Toolset Professional Support › [Resuelto] Is there a better way than using wpv-if to hide sections in a form?
Problem: I would like to know how best to conditionally show or hide certain sections of a Form based on User role.
Solution: Access Control shortcodes should work well to hide content conditionally based on User role. Otherwise, conditional HTML can be used. The preferred shortcode now is wpv-conditional instead of wpv-if.
Relevant Documentation:
https://toolset.com/documentation/user-guides/access-control-texts-inside-page-content/
https://toolset.com/documentation/user-guides/conditional-html-output-in-views/
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | - | - |
13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | - | - |
Supporter timezone: America/New_York (GMT-04:00)
Etiquetado: Access plugin, Content-submission forms, Controlling access to front-end content, Toolset Forms
Documentación relacionada:
Este tema contiene 2 respuestas, tiene 2 mensajes.
Última actualización por Gerard hace 5 años, 3 meses.
Asistido por: Christian Cox.
I'm using wpv-if to hide a section in a form. That section is only to be viewed if the viewer's role is Administrator.
I just saw here that wpv-if is on legacy support. https://toolset.com/documentation/user-guides/legacy-support-for-wpv-if/
What is the proper way to hide sections in a form based on user role?
What is the proper way to hide sections in a form based on user role?
Hi, I recommend Access Control shortcodes to show and hide form sections:
https://toolset.com/documentation/user-guides/access-control-texts-inside-page-content/
You will have to use the expert Form builder to be able to add these control shortcodes. Let me know if you have any questions about that.
Thanks a bunch Christian,
I implemented this: [toolset_access role="Administrator, Editor"] [/toolset_access]
My issue is resolved now. Thank you!