Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: Views Bootstrap 5.5.4 — Minor update available for module views_bootstrap (5.5.4). Release: Rightup theme 1.0.3 — Minor update available for theme vartheme_bs5_rightup (1.0.3). Release: CommentOn 1.0.6 — Minor update available for module commenton (1.0.6). Release: ChatGPT Ads 1.0.3 — Minor update available for module chatgpt_ads (1.0.3). Release: Opensolr Search 5.1.3 — Minor update available for module opensolr_search (5.1.3). Release: ServiceM8 Webform Integration 1.2.1 — Minor update available for module servicem8_webform (1.2.1). Release: PostfixAdmin 1.0.0 — Initial release available for module postfix_admin (1.0.0)! Release: ip_analyser 1.0.3 — Minor update available for module ip_analyser (1.0.3). Module Revived: Swagger-PHP OpenAPI 3 documentation generator 1.0.0 — Module swagger_php updated after 10 months of inactivity (1.0.0). Security Coverage: Microsoft Azure AI — Module ai_provider_azure now has official Drupal security advisory coverage.

Provides a node preview logging service, REST endpoint to fetch preview log entities and an iframe that renders a decoupled preview page. The module can be used with any frontend framework.

Benefits

  • Leverages the Drupal preview system so unsaved nodes can be previewed.
  • The api is provided as a REST plugin so authentication mechanisms and permissions are fully customizable.
  • A cron task is provided to clear out preview entities. They are afterall meant to be temporary.
  • Relationships (aka JSON:API Includes) are customizable in the settings form.

Drupal Setup

Refer to the Documentation page to install and configure the module.

Next Integration

No additional frontend libraries needed. Just create a page that can consume the iframe and request preview entity from api to pass into your node templates.

Gatsby Integration

  1. Install the gatsby-drupal-preview npm package.
  2. Follow the instructions and examples in the Readme file.

Gatsby Notes

  • Gatsby graphql data structure must match Drupal's Jsonapi public names.
  • Gatsby image plugin requires a downloaded file so it's advisable to provide a fallback for images pointing to a url to the original file on drupal and/or the use of image derivatives will also work.
  • The helper function included with gatsby-drupal-preview plugin will programmatically create a property publicUrl for file entities that links to drupal file. That can be provided as a fallback in your react components.

Similar Modules

  • JSON:API Node Preview
    As is, the module provides no viable mechanism to return preview JSON to a decoupled frontend due to same user access restrictions for the user initiating the preview.
  • GraphQL Node Preview
    Provides similar functionality to JSON:API Node Preview but is focused on GraphQL output rather than JSON:API and assumedly suffers from the same limitations.
  • Decoupled Preview
    Depends on decoupled router and is intended to work with Next.js front-end frameworks to view saved content. Simple Decoupled Preview allows viewing unsaved content.

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
13
Tracked since
Feb 2023
Latest release
2 years ago
Releases (12 mo)
0
Maintenance
Dormant

Release Timeline

Releases

Version Type Core Release date
2.0.1 Stable Jun 5, 2024
2.0.0 Stable Dec 28, 2023
1.0.0 Stable Dec 22, 2023
2.0.x-dev Dev Dec 22, 2023
1.0.0-rc3 Pre-release Dec 5, 2023
1.0.0-rc2 Pre-release Jun 6, 2023
1.0.0-rc1 Pre-release Mar 16, 2023
1.0.0-beta5 Pre-release Mar 13, 2023
1.0.0-beta4 Pre-release Mar 9, 2023
1.0.0-beta3 Pre-release Mar 6, 2023
1.0.0-beta2 Pre-release Mar 3, 2023
1.0.0-beta1 Pre-release Mar 3, 2023
1.0.x-dev Dev Feb 28, 2023