Images can be displayed alongside questions to provide additional information to respondents and to increase their engagement. To display an image with a question's text, use the show image tag.
For information on including images with answer options or table rows, see Option and row images.
Tip! The platform accepts a variety of image input types, such as .jpg/.jpeg, .png, and animated .gif files. If you need to add a video to your survey, see Embedding and referencing videos in SPL.
Details
- First, image files should be uploaded to your survey's images folder in the Files applet.
- Then, attach the image to a question's text by applying the
show imagetag to the question (or table) with the image file name as its input. - Images may be formatted via image tags that also can be applied as decorators.
- Questions and tables can include images at both the question-level and option-level.
Image tags and decorators
The following tags and decorators can be used alongside show image to format images. To apply a decorator, omit the word "image," and use the remaining text as the decorator label.
| As a tag | As a decorator | Description |
image alt text |
alt text |
Functions similarly to the text decorator and specifies alternate text to display in place of the image if it cannot be displayed, e.g., image alt text: Image of a [text]. |
image label placement |
label placement |
Specifies where the question text should be displayed in relation to the image. Inputs include: |
image max height |
max height |
Specifies the maximum displayed height of the image in pixels, e.g., image max height: 200. |
image max width |
max width |
Specifies the maximum displayed width of the image in pixels, e.g., image max width: 200. |
image placement |
placement |
Specifies where the image should be displayed in relation to the question text. Inputs include: Note that 'only' indicates to show the image without the question text. |
Additional examples
Formatting question images
The tags for formatting question images can be applied as decorators following the show image tag, allowing for a more compact question code. A comparison of the two coding methods is shown below.
Changing the question text position
Use the image label placement tag or label placement decorator to control where the question text appears in relation to the image. The designated text space differs depending on the question or table structure, but within this space, the text can be pushed into one of nine directions:
- left-top
- left-middle
- eft-bottom
- right-top
- right-middle
- right-bottom
- center-top
- center-middle
- center-bottom
A few possibilities are demonstrated below.
Comments
0 comments
Please sign in to leave a comment.