Static Content¶
The staticContent feature supports various functions:
- Design customizations: Corporate design
- Custom logo
- Static pages: Help, documentation, and information pages
- Additional sound files
The staticContent must be configured in
- config.json ClientConfiguration.
- The files must be stored on the server.
- For updates of the
static-contentzip, the number instaticContent.versionof config.json must be increased and add instatic-content-<version>.zip. The mobile client downloads the new version on the next logout/login or refresh of the app.
Recommendation
We recommend using the upload function via setup insight-cli. This automatically generates the zip file and the version. All you need to do is save the files and config.json, and insight-cli will take care of the rest.
config.json¶
The settings for staticContent are defined in config.json.
Example config.json:
{
"staticContent": {
"version": "1.0",
"logo": true,
"logoDarkMode": true,
"css": true,
"pages": []
}
}
Folder structure¶
Where to place the files?
- Absolute URLs can be provided on every server.
- Relative URLs must follow the following conventions:
- They must be stored
- next to the config.json in static-content
- in
config/clientnext to the config.json in static-content
- They must be stored
.
├─ insight
| └─ <mobile | web>
| ├─ config.json
| └─ static-content/
│ ├─ customize.css
│ ├─ logo.png
│ ├─ logo-dark-mode.png
│ ├─ my-sound.mp3
│ ├─ legal.html
│ ├─ help.html
│ └─ my-sound.mp3
│ └─ static-content-1.zip
| └─ static-content/
│ ├─ customize.css
│ ├─ logo.png
│ ├─ logo-dark-mode.png
│ ├─ legal.html
│ ├─ help.html
│ └─ my-sound.mp3
.
├─ insight
| └─ config
| └─ client
| ├─ config.json
| └─ static-content/
│ ├─ customize.css
│ ├─ logo.png
│ ├─ logo-dark-mode.png
│ ├─ legal.html
│ ├─ help.html
│ └─ my-sound.mp3
│ └─ static-content-1.zip
| └─ static-content/
│ ├─ customize.css
│ ├─ logo.png
│ ├─ logo-dark-mode.png
│ ├─ legal.html
│ ├─ help.html
│ └─ my-sound.mp3
Design customizations: Corporate design (customize.css and custom logo)¶
The Insight Client can be set to the customer's CI. It is possible to change colors and display a customer logo. Two files are required for this: logo.png and customize.css. For dark mode, it is possible to add a different logo with the name logo-dark-mode.png. The files are stored in the static-content directory and zip. In addition, settings must be made in config.json.
The customize.css is described here: customize
Examples follows below.
| staticContent | |
|---|---|
version |
the client checks the version and only downloads the static content if the number increases |
css |
if true, the customize.css in static-content will be used |
logo |
if true, the logo in static-content will be used |
logoDarkMode |
if true, an other logo for dark mode in static-content will be used |
"staticContent": {
"version": "1.0",
"logo": true,
"logoDarkMode": true,
"css": true
}
Pages¶
The HTML pages can be integrated into a navigation module or displayed via a menu. In addition, pages can be shown on the login screen. The URL to the page can be relative or absolute. Absolute URL's can only be used online. Relative URL's can be used online and offline if a download package is available.
Page in navigation module with order:¶
{
"staticContent": {
"pages": [
{
"name": "legal",
"title": "Legal",
"icon": "icon-fire",
"url": "static-content/legal.html",
"module": "Infos",
"order": 5
}
]
}
}
Hidden page with menu:¶
{
"staticContent": {
"pages": [
{
"name": "legal",
"title": "Legal",
"icon": "icon-fire",
"url": "static-content/legal.html",
"hidden": true
}
]
}
}
"menus": [
{
"label": "Legal",
"icon": "icon-fire",
"action": "staticContent",
"actionValues": [
{
"name": "legal"
}
]
}
]
Show page on the login screen¶
{
"staticContent": [
{
"name": "legal",
"title": "Legal",
"icon": "icon-fire",
"url": "static-content/legal.html",
"loginPage": true
}
]
}
Sounds¶
Sound files can be played in validation functions.