Prerequisite for this guide, you must install the package DAM for Sitecore JSS-11.1.zip
The connector comes with a fieldserializer for each of the 3 custom field types: asset, assetlink and assetlist. The config can be found in the file App_Config\Include\damforsitecore\DFS.JSS.Digizuite.config.
<?xml version="1.0" encoding="utf-8" ?> <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:role="http://www.sitecore.net/xmlconfig/role/" xmlns:search="http://www.sitecore.net/xmlconfig/search/"> <sitecore> <pipelines> <group groupName="layoutService"> <pipelines> <getFieldSerializer performanceCritical="true"> <processor patch:before="processor[@type='Sitecore.LayoutService.Serialization.Pipelines.GetFieldSerializer.GetDefaultFieldSerializer, Sitecore.LayoutService']" type="DFS.JSS.Serializers.GetAssetFieldSerializer, DFS.JSS" resolve="true"> <FieldTypes hint="list"> <fieldType id="1">Asset</fieldType> </FieldTypes> </processor> <processor patch:before="processor[@type='Sitecore.LayoutService.Serialization.Pipelines.GetFieldSerializer.GetDefaultFieldSerializer, Sitecore.LayoutService']" type="DFS.JSS.Serializers.GetAssetLinkFieldSerializer, DFS.JSS" resolve="true"> <FieldTypes hint="list"> <fieldType id="1">Assetlink</fieldType> </FieldTypes> </processor> <processor patch:before="processor[@type='Sitecore.LayoutService.Serialization.Pipelines.GetFieldSerializer.GetDefaultFieldSerializer, Sitecore.LayoutService']" type="DFS.JSS.Serializers.GetAssetListFieldSerializer, DFS.JSS" resolve="true"> <FieldTypes hint="list"> <fieldType id="1">Assetlist</fieldType> </FieldTypes> </processor> </getFieldSerializer> </pipelines> </group> </pipelines> </sitecore> </configuration>
Usisng the Sitecore Layout Services /sitecore/api/layout/render/[config]?item=[path]&sc_lang=[language]&sc_apikey=[key]
. The json output for each of the 3 fieldserializers can configured. The configuration can be found in the file App_Config\Include\damforsitecore\DFS.Settings.config. The default config looks like this:
<DFS.JSS.FieldSerializer> <property outputName="assetTypeId" propertyName="AssetTypeId" /> <property outputName="title" propertyName="Name" /> <quality outputName="src" /> <quality outputName="src_download" download="true" /> </DFS.JSS.FieldSerializer>
This is an example of the out for the fieldtype asset.
"DFS Medie": { "value": { "assetTypeId": 4, "title": "Butterfly", "src": "/dfsmedia/baeefe6b74df44be8a2bccfb2c57af8e/114-50036/butterfly", "src_download": "/dfsmedia/baeefe6b74df44be8a2bccfb2c57af8e/114-50036/options/download/butterfly" } }
Configuration
The section <DFS.JSS.FieldSerializer>
can contain 2 different types tags property
and quality
.
The following attributes are avaible for the Property tag:
outputName
This is the property name of the json output.propertyName
650delimiter
This is used for properties with multiple values. The default delimiter is semicolon.
The following attributes are avaible for the Quality tag:
outputName
This is the property name of the json output.qualityId
download