How do I add a conditional segment to a published answer?
Answers, Conditional Sections, HTML Editor
You can include conditional sections within an answer so that the section can only be viewed by users who have been granted privileged access to that access level. That is, answers will display public content to general users and the same answer can display additional information to privileged access users when they are logged in to the end-user pages.
For example, you might have an answer that contains content for all of your site visitors. For your premier customers, though, you might want to include an additional sentence or paragraph that includes a priority phone number for receiving support. Instead of creating an entirely separate answer for your premier customers, you can simply add a conditional section to your answer so that only people that can view your premier access level will see that content. General users will not be able to see the content of the conditional section.
Within an answer, you can have multiple conditional sections defined and those sections can be conditional for different access levels. This allows you to display content for users with different levels of privileged information.
Configuring a Custom Access Level
Conditional sections are used primarily with privileged access. In order to add the conditional section, you must have a custom access level configured for use. When setting up a custom access level for privileged access, use the steps below.
- From the Configuration items, select Application Appearance > Customizable Menus > Answer Access Levels.
- In the left frame, click on System Menus arrow and select Add Answer Access Level.
- To add a new access level click the New button on the ribbon. Do NOT check the Interface Visibility checkboxes. Leaving the checkbox blank is what sets the access level for use with privileged access.
- Click Save.
- Use the arrows to set the newly created access level above the Everyone and Help access levels.
Note: These steps only address part of the overall configuration for privileged access. For complete instructions for setting up privileged access in your site, refer to Answer ID 1838: Setting up Privileged Access.
Creating an Answer with a Conditional Section
From the HTML Editor: If you are using the HTML editor to create answer content, you can add a conditional section to your answer using the Conditional Section icon. Use the steps below:
- Open the answer for editing.
- From the editor ribbon, click the Conditional Section icon (In 17D and older, this option is available from the Answer Actions toolbox.)
- Enable the access level(s) that are allowed to view the contents in the section. You can enable multiple access levels if necessary.
- Within the blue frame that is added to the answer, enter the content specific to your conditional section.
- Save the answer.
Preview the Answer
Before you publish your answer, you can preview it to determine if you have your conditional sections configured correctly. You can save the answer to a private status type and set the access level to be all of the access levels used in the conditional sections. If there is general information in the answer, you will want to include the Everyone access level. Use the CTRL key to select multiple access levels for your answer.
With the status set to a private status, you can preview your answer and the answer will not display on your end-user pages. From the top ribbon, select the Preview command. The Access Level field displays at the top of the preview window. Select the access level that you want to view and click Preview. Verify that the conditional sections display correctly for the access level you choose. Set the access level to another level to verify that your conditional sections display or don't display based on the access level you choose.
Once you have verified that your conditional sections are working correctly, you can re-edit your answer and set the status to a public status type so that the answer is published to your end-user pages. Once published, the content that displays to your end-users will depend on which access levels that user can view.
To edit a conditional section, you can edit the content within the blue box to change the content of your conditional section. To change the access level(s) for the section, double click on the section heading and the access level pop-up box will display.
Note: If you do edit the access levels associated with the conditional section, make sure that when you save the answer, the Access Level field has the appropriate access levels selected to match the levels used in your conditional section.
You can nest conditional sections within other conditional sections. Place the cursor within the first conditional section and you can click the Access Level Conditional button -- to nest a conditional section within it.