Content outside of the SliceZone

Fortunately it's really easy to query content that is outside the SliceZone of your document (i.e. the body), the function useGetStaticProps has already queried this data for you. You simply need to access the data of the props variable, you can see how we’ve done this in the example below where we pass the data of a key text field called title to a H1 tag:

import { Client } from '../prismic'
import SliceZone from 'next-slicezone'
import { useGetStaticProps, useGetStaticPaths } from 'next-slicezone/hooks'

import resolver from '../sm-resolver.js'

const Page = (props) => console.log(props) || 
    <article>
      <h1>{props.data.title}</h1>
      <SliceZone {...props} resolver={resolver} />
    </article>

// Fetch content from prismic
export const getStaticProps = useGetStaticProps({
  client: Client(),
  uid: ({ params }) => params.uid
})

export const getStaticPaths = useGetStaticPaths({
  client: Client(),
  type: 'page',
  fallback: true,// process.env.NODE_ENV === 'development',
  formatPath: ({ uid }) => ({ params: { uid }})
})

export default Page
9 Rue de la Pierre Levée, 75011 Paris