Structured Data

The Flight framework uses JSON-LD to embed structured data on product pages by default.

If you would like to modify the structured product data or embed your own (for category listings, for example), there are components in the template to assist with this.

StructuredData

import { StructuredData } from '@jetshop/core/components/StructuredData'

This component can be useful if you want to embed your own structured data.

Example usage:

Copy
Copied
<StructuredData
  json={{
    "@context": "http://schema.org/",
    "@type": "Thing",
    name: "Schema.org Ontology",
    subjectOf: {
      "@type": "Book",
      name: "The Complete History of Schema.org",
    },
  }}
/>

StructuredProductData

import { StructuredProductData } from '@jetshop/core/components/StructuredData/'

This component can be used if you'd like to customise the embedded product data.

If you do use this component, you should first disable the default product data embed. You can do that by adding this to your shop.config.js:

Copy
Copied
  structuredData: {
    disableDefaultProductData: true
  }

Example usage:

Copy
Copied
<StructuredProductData product={product} extraFields={{ mpn: "customMPN" }} />

StructuredCategoryData

import { StructuredCategoryData } from '@jetshop/core/components/StructuredData/'

This component can be used if you'd like to customise the embedded product data.

If you do use this component, you should first disable the default product data embed. You can do that by adding this to your shop.config.js:

Copy
Copied
  structuredData: {
    disableDefaultCategoryData: true
  }

Example usage:

Copy
Copied
<StructuredCategoryData
  category={category}
  extraFields={{ mpn: "customMPN" }}
/>
Copyright © Norce 2023. All right reserved.