@fiftyfivetech/strapi-plugin-preview-button

1.0.0 • Public • Published

Strapi Plugin Preview Button

Add a preview button on Strapi CMS.

How To

  • Add preview-button plugin using
npm install @fiftyfivetech/strapi-plugin-preview-button
  • Add these env variables in Strapi
STRAPI_ADMIN_PREVIEW_URL=https://frontend_url.com/preview
STRAPI_ADMIN_PREVIEW_URL_SECRET=preview_secret

Make sure your content must have an unique slug field. Based on that this plugin will works. If slug is not available you can able to use documentId field.

How it works?

It will add a preview button for every content in content manager. On click it will open https://frontend_url.com/preview?secret=preview_secret&slug=homepage&collectionName=api::page.page&documentId=x45tnYUnai&isDraft=true.

You can able to easily intercept this call at your frontend (Next.js) application and read query params to fetch perform action and fetch draft mode content and show a live preview to end user.

Readme

Keywords

none

Package Sidebar

Install

npm i @fiftyfivetech/strapi-plugin-preview-button

Version

1.0.0

License

MIT

Unpacked Size

11.4 kB

Total Files

11

Last publish

Collaborators

  • ganeshagrawal55
  • amitjangid8
  • tanvi03
  • ankita_55tech
  • ayush.singhi