Static Content¶
Static files¶
With staticContent
static files like HTML pages and sounds can be integrated into web
and mobile
client. 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 staticContent
can be configured in the ClientConfiguration. The URL to the page can be relative or absolute. Absolute URL's can only be used online. In mobile
, relative URL's can be used online and offline if a download package is available. Sound files can be played in validation functions.
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/client
next to the config.json in static-content
- They must be stored
.
├─ insight
| └─ <mobile | web>
| ├─ config.json
| └─ static-content/
│ ├─ legal.html
│ ├─ help.html
│ ├─ customize.css
│ └─ my-sound.mp3
.
├─ insight
| └─ config
| └─ client
| ├─ config.json
| └─ static-content/
│ ├─ legal.html
│ ├─ help.html
│ ├─ customize.css
│ └─ my-sound.mp3
To have offline support for the staticContent, zip the static-content directory and name it static-content-<version>.zip
. Also add staticContent configuration to config.json.
.
├─ config.json
├─ static-content/
│ ├─ legal.html
│ ├─ help.html
│ ├─ customize.css
│ └─ my-sound.mp3
├─ static-content-1.0.zip
| └─ static-content/
│ ├─ legal.html
│ ├─ help.html
│ ├─ customize.css
│ └─ my-sound.mp3
For updates of the static-content
zip, the number in staticContent.version
of config.json must be increased and add in static-content-<version>.zip
. The mobile client downloads the new version on the next logout/login or refresh of the app.
Page in navigation module with order:¶
{
"staticContent": [
{
"name": "legal",
"title": "Legal",
"icon": "icon-fire",
"url": "static-content/legal.html",
"module": "Infos",
"order": 5
}
]
}
Hidden page with menu:¶
{
"staticContent": [
{
"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
}
]
}
customize.css and custom logo¶
The Insight Mobile 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
. Examples follows below.
staticContent | Works for | |
---|---|---|
version |
the client checks the version and only downloads the static content if the number increases | Mobile, Web |
css |
if true, the customize.css in static-content will be used | Mobile, Web |
logo |
if true, the logo in static-content will be used | Mobile |
logoDarkMode |
if true, an other logo for dark mode in static-content will be used | Mobile |
"staticContent": {
"version": "1.0",
"logo": true,
"logoDarkMode": true,
"css": true
}