Create Page

These examples show how to create the various types of pages in FirstSpirit.

title: Product

api
  .createPage({
    fsPageTemplate: 'product', // (1)
    id: `Product Page`,        // (2)
    type: 'product',           // (3)
    displayNames: {
      EN: `Product Page EN`,   // (4)
      DE: `Product Page DE`,
    },
  })
  .then((isSuccess) => console.log('Create Product Page: ', isSuccess ? 'SUCCESSFUL' : 'FAILED'))
  .catch((error) => console.error('Failed to create product page', error));
  1. FirstSpirit page template uid
  2. ID from shop system
  3. Page type to create (product, category or content)
  4. Display names for various languages title: Category
api
  .createPage({
    fsPageTemplate: 'category', // (1)
    id: `Category Page`,        // (2)
    type: 'category',           // (3)
    displayNames: {
      EN: `Category Page EN`,   // (4)
      DE: `Category Page DE`,
    },
  })
  .then((isSuccess) => console.log('Create Category Page: ', isSuccess ? 'SUCCESSFUL' : 'FAILED'))
  .catch((error) => console.error('Failed to create category page', error));
  1. FirstSpirit page template uid
  2. ID from shop system
  3. Page type to create (product, category or content)
  4. Display names for various languages title: Content
api
  .createPage({
    fsPageTemplate: 'contentpage', // (1)
    id: `Content Page`,            // (2)
    type: 'content',               // (3)
    displayNames: {
      EN: `Content Page EN`,       // (4)
      DE: `Content Page DE`,
    },
  })
  .then((isSuccess) => console.log('Created Content Page: ', isSuccess ? 'SUCCESSFUL' : 'FAILED'))
  .catch((error) => console.error('Failed to create content page', error));
  1. FirstSpirit page template uid
  2. ID from shop system
  3. Page type to create (product, category or content)
  4. Display names for various languages

Last update: May 19, 2025