Step 7 of 10
Configure Content Types
Configure path aliases and preview for content types
To display content on the Next.js site, we need to configure path aliases and preview mode for the content types.
Configure Path Aliases
The `next-drupal`
plugin uses paths to resolve resources for `getStaticProps`
. To make this work, we need to configure path aliases for our content types.
Let's add a pattern for the Article content type.
- Visit /admin/config/search/path/patterns/add.
- Fill in the following values:
- Pattern type:
`Content`
- Path pattern:
`blog/[node:title]`
- Content type:
`Article`
- Label:
`Article`
- Click Save
Configure Preview
To enable content preview inside Drupal, we need to configure a site resolver for the Article content type.
A site resolver tells Drupal how to resolve the preview URL for an entity.
- Visit /admin/config/services/next/entity-types
- Click Configure entity type
- Select Article from the the entity type list
- Select Site selector as the Site resolver
- Select Blog under Next.js sites
- Click Save
Done. You have completed the Drupal configuration.