4. Create schemas
Was this page helpful?
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
/** @type {Enterspeed.FullSchema} */
export default {
triggers: function(context) {
context.triggers('productListDemoPIM', ['PimCategory'])
},
actions: function (sourceEntity, context) {
context.reprocess('productCategories')
.bySchema()
.sourceGroup('productListDemoCMS')
},
properties: function ({properties: p}, context) {
return {
image: p.image,
title: p.title,
lead: p.lead,
button: p.button
}
}
}
/** @type {Enterspeed.FullSchema} */
export default {
triggers: function(context) {
context.triggers('productListDemoCMS', ['ProductList'])
},
routes: function (sourceEntity, context) {
context.url(sourceEntity.url)
},
properties: function ({properties: p}, context) {
return {
headline: p.headline,
lead: p.lead,
categories: context.reference('pimCategory')
.filter("type eq 'PimCategory'")
.sourceGroup('productListDemoPIM')
.limit(4)
}
}
}
Was this page helpful?