Appearance
Dynamic component list
The dynamic themes approach supports theme-dependent lists of components. The components you define with this approach appear in eWizard Editor, depending on a theme selected when creating a content item based on your dynamic template.
Define theme-based components
To define theme components, do the following:
Add required components to your project.
Specify the components for corresponding themes in
./common/components/components-themes.jsonof your project. This way, you're setting up components that to be displayed on the Components tab in eWizard Editor based on the selected theme.
json
/* ./common/components/components-themes.json */
{
"themes": {
/* Your theme name */
"aethercare": {
"components": [
{
"id": "wiz-text",
"name": "Therapy notes"
}
]
},
"mediplus": {
"components": [
{
"id": "wiz-title",
"name": "Evidence title"
},
{
"id": "wiz-image",
"name": "Efficacy graph"
}
]
}
}
}Make sure to provide both fields—id and name—for every component you need to be displayed per theme:
id: A string identifier for the component (e.g.,wiz-text)name: The display name shown in eWizard Editor (e.g.,Therapy notes)Field priority
The
namefield value overrides the component name defined in thecomponents.jsonfile when displayed in eWizard Editor.
With this configuration, eWizard Editor will display components as follows:
- The Therapy notes (
wiz-text) components if AetherCare is selected as the content item's theme in eWizard. - The Evidence title (
wiz-title) and Efficacy graph (wiz-image) components if MediPlus is selected as the content item's theme in eWizard.
- For local development, set your required theme as
currentin your project'ssettings.json. With it, your theme-specific components become available in development builds:
json
/* settings.json */
{
"theme": {
"default": "aethercare",
"current": "mediplus"
}
}Fallback components
eWizard Editor displays all components listed in components.json as a fallback under the following conditions:
- The
components-themes.jsonfile is missing in your project's./common/components/folder - The
currenttheme value insettings.jsondoesn't match any theme defined in./common/components/components-themes.json