-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Preview Button not visible when install Plugin using npm i strapi-plugin-preview-button@latest #119
Comments
Hi @Ram-Metapercept Could you provide more your details from your |
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 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 |
@L-Weisz The file name was already plugins.ts. I have an upload plugin and added preview-button as another plugin. |
For who is facing the same issue, I've just figured out the reason, in my case was missing the API_PREVIEW_URL on .env file, after adding API_PREVIEW_URL=http://localhost:3000/api/preview/ it's working properly and displaying the preview button on Strapi Admin |
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
The text was updated successfully, but these errors were encountered: