2021.2

Table Of Contents
Note
The pattern image was created on www.patternify.com and is added as a data URI (see
Data URIs).
Showing hidden Foundation elements
In Capture OnTheGo templates based on the Foundation framework the .DESIGN selector can
be used to show elements that would otherwise be hidden in the Design view.
For example, to expand accordion elements and show validation errors in Design view, you
could add the following style rules to your template:
.DESIGN .accordion .accordion-navigation > .content {
display: block;
}
.DESIGN small.error {
display: block;
margin-top: -20px;
}
Loading a snippet via a script
Instead of dragging it into the content directly, it is possible, and often very useful, to load a
snippet dynamically. Create a script (see "Writing your own scripts" on page877) and in the
code use the following function:
loadhtml(‘snippets/nameofthesnippet.html’).
To insert the snippet in the content at any position where the script's selector is encountered,
write results.loadhtml('snippets/nameofthesnippet.html').
Make sure that the file name is exactly the same as the file in the Snippets folder. If the file
name isn’t correct, the snippet will not appear in the template.
To load a JSON snippet in script, use: loadjson(‘snippets/nameofthesnippet.json’).
Tip
To insert the code to load a snippet even quicker, you can:
Page 904