Headers are list items that categorize the list content beneath them, much like a category label. Headers also break sets of list options into collections. Use the collection header
decorator (alias header
) next to a list item to create a collection header.
set list: ICECREAMS 100. Cream based {collection header: y} 1. Fior di latte 2. Cookies and Cream 3. Vanilla 200. Chocolate based {collection header: y} 4. Dark chocolate 5. Rocky Road 6. Milk chocolate
1. What is your favorite ice cream?
type: checkbox
optsfrom: ICECREAMS
Note: Headers that use IDs composed of an underscore and letter (e.g., ' _A.') can still be used in r9+ versions of the software. However, using numeric IDs is highly encouraged in order to take advantage of newer features that are currently available or planned for a future release.
Details
- To create a collection header, assign a numeric option ID to a list item. Then, place the
{collection header: y}
decorator next to the list item. - Headers can be displayed or hidden on screen to respondents. When a header is shown alongside its contents, it serves as a visual purpose and is not selectable. When it is displayed alone, representing the whole category, it is selectable.
- List options will be displayed in the order they are programmed unless an
order
tag or additional decorators are added to modify the placement. For more information, see Ordering multiple collections (r9). - To include or exclude a header and all options within its collection, reference the header ID at the listcall the same way you would include or exclude option IDs (e.g.,
optsfrom: LISTNAME -[100]
). - Similar to the inclusion/exclusion syntax, placing
[header: n]
after a listcall will filter headers "out" of a list, while[header: only]
will pull only headers into a question. See example below. - Ranking questions also support collection headers.
Tags
The following tags can be applied to a table to adjust the collection headers' formatting and positioning.
Decorator | Description |
collectionpunchsummary |
Creates a summary variable that records any collection headers in a list that had at least one of their "child" options selected. |
columngroupheader |
If a list with headers is used as columns in a table, the headers will not display by default. To show the headers, apply |
columngrouptext |
Locally defines the group collection header across the columns instead of pulling it from the list, replacing the |
rowheadingalign |
Changes the default alignment of the collection headers used as rows from 'center' to either 'right' or 'left'. |
Decorators
The following decorators can be used alongside the collection header
decorator. This list is not exhaustive.
Decorator | Description | Example |
alphabetize |
Alphabetizes all options within a collection. | 100. Chocolate Candy {collection header: y} {alphabetize: y} |
desc |
Specifies a custom description for a header in the reports. | 100. Other {collection header: y} {desc: other write-ins} |
explain |
Creates an "i" icon for more information and shows helpful text when a cursor is positioned over the icon. |
|
order |
Specifies an order for the collection. |
100. Chocolate Candy {collection header: y} {order: (3,2,1)} |
randomize |
Randomizes all options within a collection. |
100. Chocolate Candy {collection header: y} {randomize:y} |
translate |
Specifies how a collection should be translated. By default, it will be translated. Use 'n' to exclude it from all translations, or specify applicable language code(s) to include it in specific translations. |
100. Apps {collection header: y} {translate: n} |
Tip! Decorators for collection headers are being actively improved. Check back in future releases for updates and new features.
Additional examples
Behavior with conditions
In the example below, the anyChecked
condition in Q3's listcall dictates that only answers selected in Q2 should be shown. Since the COLORS list has two collections, the headers from these questions are also displayed in Q3.
Notice that if you only make selections from one of the collections, e.g., only blue colors, then only the "Blues" header will be shown in Q3.
Filtering collection headers
As shown in the previous example, if a header's collection is empty after applying exclusion or condition filters, the header is automatically hidden. Headers are also ignored by the system when the list is used in a block. In all other cases, use [header: n]
at the listcall to manually hide the headers.
Conversely, you might need to only show the headers from a list (i.e., the categories). Instead of creating a new list with just the headers as the option items, just apply the [header: only]
filter at the listcall.
Using option data on collection headers
A set list with collection headers can also have option data attached to its items and headers. In the example below, Q23 uses the text
decorator to display the text from the option data label 'LC'.
Then, at Q23A the header: only
filter is used to pull in only the collection headers. However, the option data label 'PRIMARY' is also applied as a filter, so only 'Alcohol' and 'Health & Beauty' will ultimately show to the respondent.
Please scroll vertically to see the full demo.
Version Notice: This article covers features in our r9/IS Pro platform. If you're looking for information on this topic related to r8, see Collection headers.
Comments
0 comments
Please sign in to leave a comment.