Sure. For context, this is an online course where the user responds to Toolset Custom User Fields throughout, then these values are either displayed back to the user so it feels more personalized, or they are used to create conditional views so the user sees different things depending on what they've chosen in the past.
Below is an example post. All forms are User Forms, and all fields are User fields attached to the Current User. Fork field options are Left (1), Right (2), Straight (3). Fork Solution options are Solution 1, Solution 2, Solution 3.
As you can see, I have a lot of different combinations of field values in the statements below with some redundancy… wondering if it is better to nest them inside common conditions instead?
<!-- ***FIRST TIME VISIT TO PAGE, OR REFRESH FROM DIFFERENT PAGE*** —>
<!-- ***LEFT FORK*** -->
[wpv-conditional if="('[wpv-search-term param="_success"]' EQ '') AND ('[types usermeta='fork' output='raw' current_user='true'][/types]' EQ '1')"]
You have taken the left fork, and you have not yet responded to the Fork Solution Form.
[cred_user_form form='fork-solution-form']
[/wpv-conditional]
<!-- ***RIGHT FORK*** -->
[wpv-conditional if="('[wpv-search-term param="_success"]' EQ '') AND ('[types usermeta='fork' output='raw' current_user='true'][/types]' EQ '2')"]
You have taken the right fork, and you have not yet responded to the Fork Solution Form.
[cred_user_form form='fork-solution-form']
[/wpv-conditional]
<!-- ***STRAIGHT*** -->
[wpv-conditional if="('[wpv-search-term param="_success"]' EQ '') AND ('[types usermeta='fork' output='raw' current_user='true'][/types]' EQ '3')"]
You have gone straight at the fork, and you have not yet responded to the Fork Solution Form.
[cred_user_form form='fork-solution-form']
[/wpv-conditional]
<!-- ***AFTER RESPONSE TO FORK-SOLUTION-FORM*** -->
<!-- ***LEFT FORK – SOLUTION 1*** -->
[wpv-conditional if="('[wpv-search-term param="_success"]' NE '') AND ('[types usermeta='fork' output='raw' current_user='true'][/types]' EQ '1') AND ('[types usermeta='fork-solution' output='raw' current_user='true'][/types]' EQ '1')"]
You met an obstacle on the Left path and chose Solution 1. But this solution won’t work. You must make another choice.
[cred_user_form form='fork-solution-form']
[/wpv-conditional]
<!-- ***LEFT FORK – SOLUTION 2*** -->
[wpv-conditional if="('[wpv-search-term param="_success"]' NE '') AND ('[types usermeta='fork' output='raw' current_user='true'][/types]' EQ '1') AND ('[types usermeta='fork-solution' output='raw' current_user='true'][/types]' EQ '2')"]
You met an obstacle on the Left path and chose Solution 2. This was the best solution.
[/wpv-conditional]
<!-- ***LEFT FORK – SOLUTION 3*** -->
[wpv-conditional if="('[wpv-search-term param="_success"]' NE '') AND ('[types usermeta='fork' output='raw' current_user='true'][/types]' EQ '1') AND ('[types usermeta='fork-solution' output='raw' current_user='true'][/types]' EQ '3')"]
You met an obstacle on the Left path and chose Solution 3. This was not the best solution but will work with extra effort.
[/wpv-conditional]
<!-- ***RIGHT FORK – SOLUTION 1*** -->
[wpv-conditional if="('[wpv-search-term param="_success"]' NE '') AND ('[types usermeta='fork' output='raw' current_user='true'][/types]' EQ '2') AND ('[types usermeta='fork-solution' output='raw' current_user='true'][/types]' EQ '1')"]
You met an obstacle on the Right path and chose Solution 1. This was not the best solution but will work with extra effort.
[/wpv-conditional]
<!-- ***RIGHT FORK – SOLUTION 2*** -->
[wpv-conditional if="('[wpv-search-term param="_success"]' NE '') AND ('[types usermeta='fork' output='raw' current_user='true'][/types]' EQ '2') AND ('[types usermeta='fork-solution' output='raw' current_user='true'][/types]' EQ '2')"]
You met an obstacle on the Right path and chose Solution 2. But this solution won’t work. You must make another choice.
[cred_user_form form='fork-solution-form']
[/wpv-conditional]
<!-- ***RIGHT FORK – SOLUTION 3*** -->
[wpv-conditional if="('[wpv-search-term param="_success"]' NE '') AND ('[types usermeta='fork' output='raw' current_user='true'][/types]' EQ '2') AND ('[types usermeta='fork-solution' output='raw' current_user='true'][/types]' EQ '3')"]
You met an obstacle on the Right path and chose Solution 3. This was the best solution.
[/wpv-conditional]
<!-- ***STRAIGHT – SOLUTION 1*** -->
[wpv-conditional if="('[wpv-search-term param="_success"]' NE '') AND ('[types usermeta='fork' output='raw' current_user='true'][/types]' EQ '3') AND ('[types usermeta='fork-solution' output='raw' current_user='true'][/types]' EQ '1')"]
You met an obstacle on the Straight path and chose Solution 1. This was the best solution.
[/wpv-conditional]
<!-- ***STRAIGHT – SOLUTION 2*** -->
[wpv-conditional if="('[wpv-search-term param="_success"]' NE '') AND ('[types usermeta='fork' output='raw' current_user='true'][/types]' EQ '3') AND ('[types usermeta='fork-solution' output='raw' current_user='true'][/types]' EQ '2')"]
You met an obstacle on the Straight path and chose Solution 2. This was not the best solution but will work with extra effort.
[/wpv-conditional]
<!-- ***STRAIGHT – SOLUTION 3*** -->
[wpv-conditional if="('[wpv-search-term param="_success"]' NE '') AND ('[types usermeta='fork' output='raw' current_user='true'][/types]' EQ '3') AND ('[types usermeta='fork-solution' output='raw' current_user='true'][/types]' EQ '3')"]
You met an obstacle on the Straight path and chose Solution 3. But this solution won’t work. You must make another choice.
[cred_user_form form='fork-solution-form']
[/wpv-conditional]
<!-- ***COMMON – if not left-solution1, right-solution2, or straight-solution3*** -->
[wpv-conditional if="('[wpv-search-term param="_success"]' NE '') AND ('[types usermeta='fork' output='raw' current_user='true'][/types]' NE '[types usermeta='fork-solution' output='raw' current_user='true'][/types]')"]
This is what you see if you have already responded to the Fork Solution Form, and if the combination of your Fork choice (made in the previous post) and your Fork Solution choice (made in this post) do NOT meet any of the following criteria:
- You turned left at the fork and chose solution #1
- You turned right at the fork and chose solution #2
- You went straight at the fork and chose solution #3
[/wpv-conditional]