Create Section
This example shows how to create a section by looking for the page first in order to receive its preview ID.
api
.findPage({ // (1)
locale: 'de_DE',
id: `Content Page`, // (2)
type: 'content', // (3)
})
.then((pageResult) => {
console.log('Found Page: ', pageResult);
api
.createSection({
pageId: pageResult.items[0].previewId, // (4)
slotName: 'content', // (5)
})
.then((isSuccess) => console.log('Create Section: ', isSuccess ? 'SUCCESSFUL' : 'FAILED'))
.catch((error) => console.error('Failed to create section', error));
})
.catch((error) => console.error('Failed to find page', error));
- Find the page first to retrieve the preview ID
- ID from shop system
- Page type to create (product, category or content)
- Preview ID from FirstSpirit
- Name of the slot to create a section in
Last update:
May 19, 2025