Sitecore XM & XP
Use model builders
Canvas Sitecore integration allows to define a model builder for component. It can be helpful when item fields isn't enough and we need to prepare data from back-end side.
Uniform.ModelBuilders.IModelBuilder, Uniform.ComponentModel interface
datasourceItem - current datasource item (can be the same as a page item)
<result> - json-serializable object
Register model builder via Sitecore config
@uniformdev/canvas-sitecore package contains a few helpers to work with model builders.
create an enhancer from
Implement model builder#
In Visual Studio, create a new project
- Project template: Class Library (.NET Framework)
- Framework: 4.6.2+
Add the Sitecore NuGet repository as a package source in your solution.
Add the Uniform NuGet repository as a package source in your solution.
Contact our support team for a link to this repository.
Add a reference to the following packages:
Implement Sample Rendering model and model builder
Register Sample Rendering model builder
App_Config\Include\zzz_MySite\MySite.Uniform.Canvas.config config with the following content
Item model builder#
Uniform.ModelBuilders.ItemFieldsModelBuilder, Uniform.ComponentModel allows to build simple models without custom code.
Define model dependencies#
Model builders may have implicit Sitecore item dependencies. In order to support incremental cache purge for Data Types, we need to define such kind of dependencies explicitly.
You can skip this step if you don't intend to utilize Data Types.
This functionality requires latest
v7.2-patch-2 version of the Uniform connector (Sitecore package named
Uniform Canvas v7.2.230517-1 Upgrade Package for UFS v7.2) which needs to be installed on top of previously installed
v7.2-patch-1 (Sitecore package named
Uniform Canvas v7.2.23XXXX for Sitecore 8.2.0-10.3.0). If you use .NET SDK please make sure to update your dependencies as per packages.config
Uniform.Models.ModelBuilderResult, Uniform.ComponentModel as model builder result