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));
  1. Find the page first to retrieve the preview ID
  2. ID from shop system
  3. Page type to create (product, category or content)
  4. Preview ID from FirstSpirit
  5. Name of the slot to create a section in

Last update: May 19, 2025