[wpv-conditional if="( '[wpv-current-user info="role"]' eq 'administrator' ) "]
<!-- content to be shown only when this is true inside here -->
[/wpv-conditional]
My question now is: What code exactly do I paste into the conditional box?
Or: Where do I find the code to put INTO the condition, in the middle.
If I only put in the code above (see screenshot in attachment) it's not working.
I'm sorry, I'm not super-experienced in programming and would appreciate a helping hand here.
Many thanks
Gabriele
What you should do is:
- Switch to Expert Mode of your form
- And then add the conditional shortcode and adjust it as per your requirement and save the form
As you can see with the following image - there is a option "Expert mode" available at top right corner, you should activate it and you will be able to edit/build your form manually. There within the form's editor you should add the conditional statement and wrap your field with this conditional statement.
=> hidden link
Got it! And it's working! Thank you so much for your patience, providing a picture and explaining until I got onto the right path. I'm happy this problem is resolved now. Thank you!
I thought I'd do a little follow-up and explain the solution in more detail, for those like me who are not fluent programmers:
When you have a conditional fieldgroup like this (pic. 1) klick down and choose the method of appearance of your choice (pic. 2). DON'T "edit conditions manually", you have to enter the code elsewhere. Click "ok" to close this little window. Scroll up to the button "expert mode" on the right side, just under the heading "form editor", like described above. You are warned, that "changes that you make in the HTML editor will be lost if you switch back to the Visual editor", which is correct. (Been there, done that.) So make sure your form is finished or be prepared to build the conditional fieldgroup again, if you have to make additional changes to the form in the visual editor. Scroll down until you reach "cred_show_group" which marks the beginning of the conditional part (pic. 3). Replace the opening part with your desired opening part (in my case: [wpv-conditional if="( '[wpv-current-user info="role"]' eq 'administrator' ) "] ) (pic. 4), and further down replace the closing "[/cred_show_group]" with your closing"[/wpv-conditional]". Save the form and you're good to go.
Note that if you switch back to the visual editor, the conditional part will be lost and you will have to build it again.
I thought I'd do a little follow-up and explain the solution in more detail, for those like me who are not fluent programmers:
When you have a conditional fieldgroup like this (pic. 1) klick down and choose the method of appearance of your choice (pic. 2). DON'T "edit conditions manually", you have to enter the code elsewhere. Click "ok" to close this little window. Scroll up to the button "expert mode" on the right side, just under the heading "form editor", like described above. You are warned, that "changes that you make in the HTML editor will be lost if you switch back to the Visual editor", which is correct. (Been there, done that.) So make sure your form is finished or be prepared to build the conditional fieldgroup again, if you have to make additional changes to the form in the visual editor.
Scroll down until you reach "cred_show_group" which marks the beginning of the conditional part (pic. 3). Replace the opening part with your desired opening part (in my case: [wpv-conditional if="( '[wpv-current-user info="role"]' eq 'administrator' ) "] ) (pic. 4), and further down replace the closing "[/cred_show_group]" with your closing"[/wpv-conditional]". Save the form and you're good to go.
Note that if you switch back to the visual editor, the conditional part will be lost and you will have to build it again.