Preview Button not visible when install Plugin using npm i strapi-plugin-preview-button@latest
Opened this issue · 7 comments
I am installing Plugin with latest version of strapi but not visible eventhough I run command npm run build and added code in my config/plugin.js file by just following https://market.strapi.io/plugins/strapi-plugin-preview-button documention but not getting my problem solved. if anyone has solution please help me
Thank you
Hi @Ram-Metapercept Could you provide more your details from your package.json
and config/plugins.js
files? Have you also tried restarting or rebuiding your app?
I've got this issue, it's any new entries in a collection don't have the preview button. Old entries in a collection are all good:
This is my config file:
module.exports = ({ env }) => {
return {
"preview-button": {
config: {
contentTypes: [
{
uid: "api::page.page",
draft: {
url: `${env("FRONTEND_URL")}/api/preview`,
query: {
slug: "{slug}",
secret: env("FRONTEND_PREVIEW_SECRET"),
},
},
published: {
url: `${env("FRONTEND_URL")}/api/preview`,
query: {
slug: "{slug}",
secret: env("FRONTEND_PREVIEW_SECRET"),
},
},
},
],
},
},
};
};
All running locally, I've rebuilt, restarted the CMS and changed node versions.
Hello, did you find a way to make it work ? I have the same issue
Hi @Ram-Metapercept @dwhiteGUK @L-Weisz Please make sure to provide your package.json
details in addition to your config/plugins.js
as it can be very helpful in diagnosing this kind of issue.
As of right now, the current stable version of Strapi is v4.14.5 so please make sure you are using that one. There are also alpha releases for v4.15.x and you should avoid that until the alpha label is removed.
Hi @mattmilburn, I configured as per the documentation but I don't see the preview button.
Here is the config:
export default ({ env }) => ({
'preview-button': {
config: {
contentTypes: [
{
uid: "api::home-page.home-page",
draft: {
url: "http://localhost:3000/homepage",
query: {
mode: "preview",
},
openTarget: '_blank',
alwaysVisible: true,
},
},
],
},
},
});
package.json
{
"name": "strapi-cms",
"version": "0.1.0",
"description": "A Strapi application",
"scripts": {
"dev": "strapi develop",
"start": "NODE_ENV=production strapi start",
"build": "strapi build",
"strapi": "strapi"
},
"dependencies": {
"@ckeditor/strapi-plugin-ckeditor": "^0.0.10",
"@strapi/plugin-cloud": "4.17.1",
"@strapi/plugin-i18n": "4.17.1",
"@strapi/plugin-users-permissions": "4.17.1",
"@strapi/provider-upload-aws-s3": "^4.17.1",
"@strapi/strapi": "4.17.1",
"better-sqlite3": "8.6.0",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react-router-dom": "5.3.4",
"strapi-plugin-preview-button": "^2.2.1",
"styled-components": "5.3.3"
},
"author": {
"name": "Admin"
},
"strapi": {
"uuid": "39c6dbea-1674-4254-8754-cfa3a0904ca7"
},
"engines": {
"node": ">=18.0.0 <=20.x.x",
"npm": ">=6.0.0"
},
"license": "MIT"
}
Hello I solved my problem I had named the file plugin.ts
instead of plugins.ts
, the s was missing, check the name of your file @barath-kumar-tw
@L-Weisz The file name was already plugins.ts. I have an upload plugin and added preview-button as another plugin.
![Screenshot 2024-01-19 at 10 17 55 AM](https://private-user-images.githubusercontent.com/115152613/297956545-4f80dd8c-e856-42c4-8212-2233139bce29.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjUwODkyMzAsIm5iZiI6MTcyNTA4ODkzMCwicGF0aCI6Ii8xMTUxNTI2MTMvMjk3OTU2NTQ1LTRmODBkZDhjLWU4NTYtNDJjNC04MjEyLTIyMzMxMzliY2UyOS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwODMxJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDgzMVQwNzIyMTBaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0yNjMyYWRhZGYwYjAyNmUxNjMzYjk4MjRlOTc3ZmI0YmE4ZTlhZDY3ZDU5OTQ1MDk3MjlhMTk5MTAzOWRmOWE0JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9._swHliPid9ADzPUza2m0GyFoz5N4G_0wbvaNXiHHU2w)