Different projects require different customisations, on this page we'll document all options you can use to match your needs.
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'],
}
);
To fetch a specific content field from a linked document, you can specify the option.
export default hydrate(Page, [], {
fetchLinks: ['author.name', 'author.picture'],
});
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',
},
],
});
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 modified | Monday, August 30, 2021, 2:00:02 PM UTC |
Last author | Colin van Eenige |
Commit ID | fd08685 |