Socket
Socket
Sign inDemoInstall

strapi-plugin-preview-button

Package Overview
Dependencies
10
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    strapi-plugin-preview-button

Add a preview button to the content manager edit view.


Version published
Weekly downloads
6.6K
increased by3.64%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Preview Button

Add a preview button to the content manager edit view.

Required environment vars
STRAPI_PREVIEW_SECRET
STRAPI_PREVIEW_DRAFT_URL
STRAPI_PREVIEW_PUBLISHED_URL
Enable the plugin

Start by adding the following code to /config/plugins.js.

module.exports = {
  'preview-button': {
    enabled: true,
    resolve: './node_modules/strapi-plugin-preview-button',
    config: {},
  },
};
Configure content types to use the preview button

In the config prop for preview-button, add a contentTypes property as an array of uids.

config: {
  contentTypes: [
    'api::page.page',
    'api::post.post',
  ],
}
OR provide a configuration object for content types

Content type objects for drafts may include a query string object while published items may include a basePath for the destination URL.

config: {
  contentTypes: [
    'api::page.page',
    {
      uid: 'api::post.post',
      draft: {
        query: {
          type: 'post',
        },
      },
      published: {
        basePath: 'blog',
      },
    },
  ],
}

Keywords

FAQs

Last updated on 10 Feb 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc