The bare
tag simplifies the HTML generated by content in blocks and set/show conditioned text
widgets. This is useful in situations where the HTML created by these widgets is having undesirable effects on the survey page, such as when using the cell
tag or custom scripts.
To use bare
in blocks, include bare: y
on the block definition (along with the required inline
tag). In set/show conditioned text
, include bare: y
as a tag.
Syntax
# Used in a bock: block: <<END # Block content goes here END inline: y bare: y list: system.1to5 # Used in a set conditioned text: setct: MYTEXT bare: y 1. brand is { if anyChecked($Q1,1) } 2. brands are { if anyChecked($Q1,2) }
HTML examples
A regular inline block (without bare
) wraps all of the HTML content it contains within an outer <div>
element. Additionally, each block iteration is wrapped with a <div>
.
Regular inline block with no 'bare' tag | |
---|---|
Code | HTML |
block: <<END Not So Bare END inline: y list: system.1to5 |
<div id="ANON_1_OUTER_4-wrapper"> <div id="ANON_1_INNER_5-wrapper"> <div class="i-freetext">Not So Bare</div> </div> <div id="ANON_1_INNER_8-wrapper"> <div class="i-freetext">Not So Bare</div> </div> <div id="ANON_1_INNER_11-wrapper"> <div class="i-freetext">Not So Bare</div> </div> <div id="ANON_1_INNER_14-wrapper"> <div class="i-freetext">Not So Bare</div> </div> <div id="ANON_1_INNER_17-wrapper"> <div class="i-freetext">Not So Bare</div> </div> </div> |
A bare block has a more simplified HTML output. Compare this HTML output to the one above. Notice that each free text iteration of "Quite Bare Indeed" is wrapped only in the <div class>
. The outer <div>
element is no longer needed.
Inline block with the 'bare' tag | |
---|---|
Code | HTML |
block: <<END Quite Bare Indeed END inline: y bare: y list: system.1to5 |
<div class="i-freetext">Quite Bare Indeed</div> <div class="i-freetext">Quite Bare Indeed</div> <div class="i-freetext">Quite Bare Indeed</div> <div class="i-freetext">Quite Bare Indeed</div> <div class="i-freetext">Quite Bare Indeed</div> |
If the html
widget is used in place of free text, no HTML at all is generated by the block. Note, the bare
tag is still being applied here as well. This provides the cleanest output.
Inline block with the 'bare' tag and 'html' widget | |
---|---|
Code | HTML |
block: <<END html: The Barest of All END inline: y bare: y list: system.1to5 |
The Barest of AllThe Barest of AllThe Barest of AllThe Barest of AllThe Barest of All |
Example with 'showtext'
One common use of bare is to eliminate unwanted line breaks caused by <div>
elements. Here, the set conditioned text: TIME
is being placed within a showtext
widget. The text that should be displayed in lieu of '__TIME__' is being pushed to the next line. This is an undesirable effect that is not intended or wanted.
'set conditioned text' and 'showtext' with no 'bare' tag | |
---|---|
Code | Survey rendered on screen |
set conditioned text: TIME |
Here, we add the bare
tag to the set conditioned text
. Now, the line does not have the unexpected break.
'set conditioned text' and 'showtext' with the 'bare' tag | |
---|---|
Code | Survey rendered on screen |
set conditioned text: TIME |
Comments
0 comments
Please sign in to leave a comment.