- Create a normal
<template_name>.tsxfile under thesrc/templatesfolder. - Register that template in the
src/templates/templates.tsfile. Here, you will see other templates beingimportedandexported.
template-list.ts file, which looks like this:
experroTemplateMap:
default indicates that all the templates registered under this default key will be available by default for the Default Channel and all other channels. This will remain the case until we provide any channel-specific templates.
To create a channel-specific template, you need to have the channel ID, which you can get from Channel Details. Just copy it and create a new object key for experroTemplateMap.
For example, if you want to create a specific Product Details template for a second channel, different from the default channel, follow these steps:
- Create a
<template_name>.tsxfile for the new template. - Update the
experroTemplateMapto include a new key for the channel ID.
experroTemplateMap will look:
Product Details template is available for the default channel, while the Product Details Exp 2 template is specific to the channel with ID ad7e9f63-6532-4e2a-9adf-fb312a635ffe.
So, For the channel with ID ad7e9f63-6532-4e2a-9adf-fb312a635ffe, Experro will load the Product Details Exp 2 template instead of the default Product Details Default template. This allows you to have channel-specific templates while falling back to the default templates for other channels.
That’s only few steps need to perform to create a Channel specific templates.