Skip to main content

Elevate Component Mapper

Introduction

All the Elevate Applications includes a certain number of templated component that can be defined based on a certain value of the template Page level Container.

Elevate Web uses a mapper Component utility that can be found in src/components/complex/ElevateComponentMapper/ElevateComponentMapper.tsx where the map between the CMS template values and the associated Components is done.

Customization

You can customize the Elevate Component Mapping in many different ways:

  • You can update an existing Component to use a different template
  • You can add new Component and map it to existing template
  • You can add new Component with new template

Update mapping from existing Component

If you need to update an existing Component to match o different existing template, you should go to ElevateComponentMapper.tsx file, and update the switch logic for the combination of your desire to map between a template and a Component.

Add new Component

Using existing template

If you need to add a new Component to match an existing template, you should go to ElevateComponentMapper.tsx file, and update the switch logic for the combination of your desire to map between a template and a Component. Don't forget to clean the unused Components both for the import, but also for the code if those are not needed.

With new template

If you need to add a template, first you will need to update the ContainerTemplates dataType in @/dataModels/container.ts adding the new template value with a map and then do the same than for the previous case.