DPDK Architecture  ->  Library (v3.4.4)

Additional options

Different projects require different customisations, on this page we'll document all options you can use to match your needs.

Order

Order can be defined for dynamic sections, this is useful when there's no fixed order in the CMS, but the front-end requires it.

export default hydrate(
  Page,
  [
    {
      home: Home,
      text_image: TextImage,
    },
  ],
  {
    order: ['home', 'text_image'],
  }
);

fetchLinks

To fetch a specific content field from a linked document, you can specify the option.

export default hydrate(Page, [], {
  fetchLinks: ['author.name', 'author.picture'],
});

Static

There can be pages that are static (don't have data directly from the CMS). These pages can still use .getInitialProps and features like the glossary with multilingual support.

function Search() {
  return <h1>This is the static search page</h1>;
}

export default hydrate(Search, [], {
  static: true,
  translations: [
    {
      title: 'Zoeken',
      slug: '/nl/zoeken',
      language: 'nl',
    },
    {
      title: 'Search',
      slug: '/en/search',
      language: 'en',
    },
  ],
});

Request more options

We're still in the first projects with Prismic, so if there's a feature that is not included or option that you think would be good to have, let us know!

Last modifiedMonday, August 30, 2021, 2:00:02 PM UTC
Last authorColin van Eenige
Commit IDfd08685