Appearance
Dynamic block list
You can configure sets of blocks that would be available based on the selected theme in eWizard Editor. Once implemented and uploaded to eWizard, such a template appears in the eWizard Library's Add new popup. Users select the required theme for the content item they create based on your dynamic template and find your specified set of blocks on the Blocks tab.
Define theme-based blocks
To define blocks for your theme, do the following:
Add required blocks to your template. The default blocks location is
./common/blocks-library; however, your can set a custom path. Every block must be represented by a folder with the block's template VUE file.Specify the required blocks for corresponding themes in
./common/blocks-library/blocks-themes.json. For example, the following blocks will be available for theaethercareandmediplusthemes:
json
{
"themes": {
/* Your theme name */
"aethercare": {
"blocks": [
{
"id": "header-capitalized",
"name": "Header capitalized",
"icon": "/themes/aethercare/media/images/blocks-icons/header-capitalized.png"
}
]
},
"mediplus": {
"blocks": [
{
"id": "header-in-sentence-case",
"name": "Header in sentence case"
}
]
}
}
}- The
namefield value is block's label visible in eWizard Editor. iconis optional. Place block icons under the required theme in./themes/your-theme-name/media/
- Add the
DynamicBlocksLoader.vuecomponent to your template'sApp.vuein the project root:
js
<template>
<wiz-root class="m-full-width" align="center">
<DynamicBlocksLoader
:blocks-themes="blockThemes"
:blocks-list="blocksList">
</DynamicBlocksLoader>
</wiz-root>
</template>
<script>
import { DynamicBlocksLoader } from "ewizardjs";
import blocksThemesJson from "./common/blocks-library/blocks-themes.json";
import blocksJson from "./common/blocks-library/blocks.json";
export default {
name: "wiz-app",
data: function () {
return {
blockThemes: blocksThemesJson.themes,
blocksList: blocksJson.components,
};
},
components: {
DynamicBlocksLoader,
},
};
</script>With this configuration, your template will display the blocks in eWizard Editor as follows:
The Header capitalized block (
header-capitalized) if AetherCare is selected as the content item's theme in eWizard.The Header in sentence case (
header-in-sentence-case) if MediPlus is selected as the content item's theme in eWizard.
Default blocks
Default blocks are predefined by the content item theme—they're always present on your content item layout in eWizard Editor.
To add the default blocks to your template:
Specify the theme blocks under
your-theme.blocksin./common/blocks-library/blocks-themes.json.Add the
defaultBlocksarray to your required theme.Specify the required block IDs under
defaultBlocks.$defaultas follows:
json
{
"themes": {
"aethercare": {
"blocks": [
{
"id": "header-capitalized",
"name": "Header capitalized",
"icon": "/themes/aethercare/media/images/blocks-icons/header-capitalized.png"
},
{
"id": "body",
"name": "Body text"
}
],
"defaultBlocks": {
"$default": [
"header-capitalized",
"body"
]
}
}
}
}Minimum eWizard.js version requirement
To implement theme default blocks, make sure you're using eWizard.js version 5.7.0 or later.
Target system-dependent blocks
You can also set block availability for target systems. For this, add the required target system codes under your theme's blocks as follows:
json
{
"themes": {
"aethercare": {
"blocks": [
{
"id": "header-capitalized",
"name": "Header capitalized",
"icon": "/themes/aethercare/media/images/blocks-icons/header-capitalized.png"
"clm": ["viseven", "veeva", "oce-sales"]
}
]
}
}
}The available target system code values are as follows:
| Target system | Code |
|---|---|
Veeva Vault | veeva |
Salesforce Marketing Cloud | sfmc |
IQVIA | iqvia |
OCE Personal | oce-sales |
Mailchimp | mailchimp |
Eloqua | eloqua |
Adobe Campaign | adobe-campaign |
Localization-dependent blocks
Localization-dependent blocks appear under the Editor Blocks tab based on the country and language a user selects when adding a new content item.
To set up this dependency, provide the countries and languages properties with the required values in blocks-theme.json.
json
// ./common/blocks-library/blocks-themes.json
// `block-four-seasons` is visible only when `Ukraine`, `Great Britain`, or `Sweden` countries are selected and the Ukrainian, English, and Swedish languages.
{
"themes": {
"Seasonality": {
"defaultBlocks": [
{
"id": "header-capitalized",
"countries": {
"include": ["Ukraine", "Great Britain", "Sweden"]
},
"languages": ["ukr", "eng", "swe"]
}
]
}
}
}Purpose-dependent blocks (email)
purpose is an additional category for setting block dependency in emails. This category is aimed at reflecting your email purpose, for example, an invitation, follow-up, reminder, or other. You can configure the following purpose dependencies:
Default blocks to be available in the content item layout.
Blocks to be available in the eWizard Editor sidebar.
Setting up purpose-dependent blocks requires a dedicated purpose.json file in your email project.
To set up default block display in the email layout, create the ./common/metadata/purpose.json file. Then, do the following:
In
purpose.json> Define your required purposes under thepurposeobject:json// ./common/metadata/purpose.json { "purpose": [ { "code": "invitation", "name": "Invitation" }, { "code": "follow-up", "name": "Follow up" } ] }
code: the purpose code used in other settingsname: the display name of the purpose
In
./.ewizard/settings.json: referpath.metadatato yourpurpose.jsonfile:json// ./.ewizard/settings.json { "path": { "metadata": { "purpose": "common/metadata/purpose.json" } } }In
./settings.json: define thedefaultandcurrentpurposes metadata:json// ./settings.json { "metadata": { "purpose": { "default": "invitation", "current": "follow-up" } } }
defaultrefers to the default email purpose shown first in the Purpose list.currentrefers to the current purpose applied to the email template.
In
blocks-themes.json: specify the block's purpose for your default block:
You can add multiple purposes to a blockjson// ./common/blocks-library/blocks-themes.json // `my-block-with-purpose` appears in the email layout for the `follow-up` and `invitation` purposes. { "defaultBlocks": [ { "id": "header-capitalized", "purpose": [ "follow-up", "invitation" ] } ] }
The block visibility in your email layout depends on how you configure the purpose property within defaultBlocks. The following table summarizes how different configurations affect block visibility:
| Configuration | Example | Block visibility |
|---|---|---|
| Block with specified purpose(s) | {"id": "header-capitalized", "purpose": ["follow-up"]} | Visible only for specified purposes |
| Block without purposes | {"id": "header-capitalized", "purpose": []} | Not visible in any context |
No defaultBlocks.purpose array | "header-capitalized" | Visible for any purpose |
Points to consider when using CLM, localization, and purpose filters
All these filters can be a field, an array, or an object with
includeandexcludearrays.languageslists the languages the block is displayed for.
The language code must be in the three-letter ISO 3 formatcountrymust contain anincludearrayYou can define these filters in the following locations:
blocks-themes.json>defaultBlocksblocks-themes.json>blocksblocks.json
In the case of different filters of the same type (for example,
clm) defined in these locations, eWizard follows the location priority when displaying theme blocks in eWizard Editor sidebar and your content item layout.The sidebar priority from the highest to lowest:
- The
blocksfield ofblocks-themes.json blocks.json
The layout priority from the highest to lowest:
- The defaultBlocks field of
blocks-themes.json - The
blocksfield ofblocks-themes.json blocks.json
- The
Include and exclude CLM systems, localization, and purposes
You can handle clm, purpose, language, and country filters with the include and exclude properties:
includelists the filters the block is shown forexcludelists the filters the block isn't visible for
It takes priority overincludeThe block visibility in your content item layout depends on how you configure
includeandexclude. The following table summarizes how different configurations affect block visibility:includevalueexcludevalueBlock visibility trueor[]globalforcountriesfalseVisible for all values trueor[]globalforcountriesSpecific value Visible for values except for those set in excludeAny []Visible for values set in includeAny No excludeprovidedVisible for values set in includeThe same as excludeThe same as includeNot visible for the specified value falseAny Not visible for any value Any trueNot visible for any value
The example below visualizes the possible cases:
json
{
"id": "contract-template-block",
// Case 1: Visible for all CLM systems (using `true`)
"clm": {
"include": true,
"exclude": false
},
// Case 2: Visible only for specified purposes
"purpose": {
"include": ["invitation", "follow-up"],
"exclude": []
},
// Case 3: Visible for all countries except Sweden and France
"countries": {
"include": ["global"],
"exclude": ["Sweden", "France"]
},
// Case 4: Not visible for English and French languages
"languages": {
"include": ["eng", "fra"],
"exclude": ["eng", "fra"]
}
}Custom block paths
You can store blocks in various directories within your project and specify their paths in the blocks.json and blocks-themes.json files. The path specified in blocks-themes.json takes precedence over the path in blocks.json.
Path configuration
To configure a custom path for a block:
- Add the block to your desired directory (e.g.,
./blocks/header-capitalized) - Specify this path in the
pathfield for that block inblocks-themes.json:
json
// ./common/blocks-library/blocks-themes.json
{
"themes": {
"Unbranded": {
"blocks": [
{
"id": "header-capitalized",
"name": "Header capitalized",
"path": "blocks/header-capitalized"
},
{
"id": "header-in-sentence-case",
"name": "Header in sentence case"
}
]
}
}
}Path resolution priority
eWizard.js resolves block paths in the following order:
- The
pathfield inblocks-themes.json(highest priority) - The
pathfield inblocks.json(medium priority) - The default path from
.ewizard/settings.json(lowest priority)
json
// ./.ewizard/settings.json
{
"path": {
"blocks": "common/blocks-library",
"blocksManifest": "common/blocks-library/blocks.json"
}
}Block filtering EMAILS
In your email projects, you can configure block filtering. It sets the dependency between the list of available blocks and the metadata selected by the user in the eWizard Library.
The filtering is supported for the following email template parameters:
- Country
- Target system
- Language
In templates with configured block filtering, the list of blocks available in the eWizard Editor depends on the Country, Target system, and Language metadata specified.
To configure block filtering, specify the required metadata field values in the blocks.json file as include and exclude for your required metadata objects. For example, to set the header-capitalized block to be displayed for France and the French language, do the following:
json
{
"id": "header-capitalized",
"country": {
"include": "France"
},
"language": {
"include": "fra"
}
}Use exclude to restrict the display of blocks based on the selected metadata. For example, to set the header-capitalized block to never be displayed for:
- Countries France and Ukraine and the languages French and Ukrainian,
configure the block's properties inblocks.jsonas follows:
json
{
"id": "header-capitalized",
"country": {
"exclude": ["France", "Ukraine"]
},
"language": {
"exclude": ["fra", "ukr"]
}
}Once done, archive your email template and upload it to eWizard. The header-capitalized block will be available for selection in eWizard Editor only if users pick the metadata set under the include property.