Text widgets allow you to display content on survey pages separate from the questions. They support HTML for adding images, tables, and other custom content. There are two types:
-
show text
: Displays content once, where it's placed in the Survey Programming Language (SPL). -
set text
: Creates content that can be inserted, or piped, repeatedly throughout the survey.
Single-use content with 'show text'
show text: INTRO
text: Welcome to this section of the survey.
Details
- Create a
show text
by providing a descriptive ID, followed by thetext
tag with the content to be displayed. - The
show text
widget supports heredoc syntax. -
show text
also supports tags such asshowif
to conditionally display content based on previous answers or other survey logic. - By default,
show text
inserts a new survey page, but this can be prevented withautopage: n
.
Multi-use content with 'set text'
set text: PRODDESC
text: This product has these features...
1. What do you like most about this product?
preface: __PRODDESC__
type: textbox
Details
- Create a
set text
by providing a descriptive ID, followed by thetext
tag with the content to be displayed. - Reference the content throughout the survey using double underscores around the ID (e.g.,
__PRODDESC__
). - Like
show text
, theset text
widget supports heredoc syntax and additional tags such asshowif
. - Unlike
show text
,set text
does not insert a page break.
show conditioned text
and set conditioned text
are advanced versions of show text
and set text
. These widgets dynamically select the content to display based on the respondent's answers or survey logic. For more information, see Conditioned text widgets.Tags
The following tags can be used with set text
or show text
widgets. Note that the use of the text
, markdown
, or html
tag is required.
Tag | Description |
autopage (alias: ap ) |
Determines if a page break is inserted before the content. |
explain |
Adds a tooltip or converts it to a dialog box with |
html |
Use this tag in place of the |
markdown |
Use this tag in place of the |
showif / skipif
|
Conditionally hides content based on previous answers or other survey logic. |
text |
Defines lines of text. |
Additional examples
Using the 'html' tag
You can use the html
tag in place of the text
tag prevent content from being wrapped in <div> </div>
tags. This is helpful when there are formatting issues, such as added line breaks.
For example:
Syntax | Survey page HTML |
show text: MYTEXT text: Survey content displayed here. |
<div id="MYTEXT-wrapper" class="i-freetext" data-widget-id="MYTEXT">Survey content displayed here.</div> |
show text: MYHTML html: Survey content displayed here. |
Survey content displayed here. |
Using the 'markdown' tag
Markdown can be used as a simpler alternative to HTML for formatting text. To use Markdown syntax, replace the text
tag with markdown
. The example below also uses heredoc to accommodate the line breaks necessary for markdown.
Syntax | Survey page |
show text: MY_MARKDOWN markdown: <<END * This is an *un-ordered* list * This is an **un-ordered** list item * Another list item 1. *Numbered* sub-list item 2. Another **numbered** sub-list item END |
Creating multiple set texts at once
The set text batch
widget (new for r9+) can be used to create multiple set text
widgets at once. Then, to display any of the set text
widgets created, reference it in the SPL by including double underscores around the set text ID.
set text batch: COMMON_INSTRUCTIONS SELECTALL. Select all that apply SELECTONE. Select one SELECTONEPERROW. Select one for each row
2. Which high-tech gadgets do you use everyday?
instructions: __SELECTALL__
type: checkbox
1. Cell phone
2. Computer
3. Video gaming unit
4. Drone
Tooltips and dialog boxes
In the example below, the 'contract' set text uses the explain
tag to insert a tooltip at Q2B. Then, the 'preferred_vendor' set text adds the dialog: y
tag to display a pop-up dialog box instead of a tooltip at Q2C.
Showing text conditionally with 'showif'
In the example below, the 'SWFAN' show text includes showif
logic. It will only be displayed if a respondent answers option 1 at QX.
Comments
0 comments
Please sign in to leave a comment.