Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation could be more accurate on some points #11

Closed
lansolo99 opened this issue Mar 9, 2022 · 8 comments
Closed

Documentation could be more accurate on some points #11

lansolo99 opened this issue Mar 9, 2022 · 8 comments

Comments

@lansolo99
Copy link

Hi, great plugin 馃憤, easygoing instructions, but maybe you should precise a couple of things, as some of us are just starting out with v4 (I struggled with these at first):

  • Precise the configuration snippet has to be place inside a plugin.js file under the config folder.
  • Precise we have to rebuild the admin first before seeing changes (you used the development mode from your screenshot, but it鈥檚 likely we鈥檒l just use the normal dev mode).
  • Precise we need to toggle the publicationState API parameter to preview when querying the content, otherwise, the draft will never be part of the response.
@lansolo99
Copy link
Author

Also, not related to the issue but, unless I am mistaken, I noticed it's not working for single types, only collection types, right?

@forntoh
Copy link

forntoh commented Mar 9, 2022

Precise we need to toggle the publicationState API parameter to preview when querying the content, otherwise, the draft will never be part of the response.

What do you mean? How do I do this?
Thanks

@lansolo99
Copy link
Author

The "publicationState" parameter is part of the Strapi API.

If we want to get the draft version from the api response, it's mandatory to set it to "preview".
As we don't want to get the enabled all the time, I guess we should use a conditional depending if we are on a preview state or not. Eg:

const postRes = await fetchAPI('/post', {
    publicationState: context.preview ? 'preview' : 'live',
    /// ...

@mpagels
Copy link

mpagels commented Mar 16, 2022

The documentation needs a revision. Unfortunately, there are missing crucial information. E.g. where to place the config file?

@mattmilburn
Copy link
Owner

Also, not related to the issue but, unless I am mistaken, I noticed it's not working for single types, only collection types, right?

Correct, but check again 馃檪. The plugin has very recently been updated to support single types 馃憤馃徎

@mattmilburn
Copy link
Owner

When it comes to configuring a plugin in Strapi, I did not include those specific details in the plugin README because those guides can already be found in the Strapi docs - https://docs.strapi.io/developer-docs/latest/setup-deployment-guides/configurations/optional/plugins.html

This plugin does not have a public API so if you are querying the API for draft/live versions, that is not related to the functionality of this plugin. Details on querying draft/live states can be found in the Strapi docs - https://docs.strapi.io/developer-docs/latest/developer-resources/database-apis-reference/rest/filtering-locale-publication.html

@lansolo99
Copy link
Author

@mattmilburn I have tested the latest version and successfully used it for a single type, so thanks for this important support! 馃憤

Regarding the install instructions, nothing mandatory of course but I think it's never too much to precise things, especially as v4 is still relatively new in the game.

Here are some examples found across other marketplace plugins:

Screenshot 2022-03-27 at 19 00 45

Screenshot 2022-03-27 at 19 01 12

Same for regarding draft/live, nothing mandatory but it helps and avoid potential struggles to have this check in mind before using the package.

I close the issue as it's not critical, all the best for this package!

@jpcmf
Copy link

jpcmf commented May 13, 2022

The documentation is confused. Any other guide to follow? Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants