mattmilburn / strapi-plugin-preview-button

A plugin for Strapi CMS that adds a preview button and live view button to the content manager edit view.
MIT License
104 stars 38 forks source link

Nothing appears to show on strapi 4.4.5 #66

Closed cherring07 closed 1 year ago

cherring07 commented 2 years ago

Nothing appears to show on the content manager view for Example Blog when I have the following added to plugins,ts. Am I missing an installation step?

 "preview-button": {
      config: {
        contentTypes: [
          {
            uid: "api::example-blog.example-blog",
            draft: {
              url: "http://localhost:1337/api/preview",
              query: {
                type: "post",
                id: "{slug}",
              },
            }
          },
        ],
      },
    },
truesri commented 2 years ago

Did you try rebuilding the admin by running yarn build?

mattmilburn commented 1 year ago

Hi @cherring07 Your plugin config looks okay to me. One thing to consider is this plugin will currently display the preview button only when the entity is in draft mode. Once it is in published mode it will show the live buttons. However, because you did not provide the published URL config, it won't show a live button when in published mode.

Is that possibly the issue you are having?

cherring07 commented 1 year ago

Thanks for replies...npm run build solved it.

I opened a PR with this added to the readme.md