diff --git a/README.md b/README.md index ccb315a6..baabcecf 100644 --- a/README.md +++ b/README.md @@ -50,9 +50,11 @@ Strapi Navigation Plugin provides a website navigation / menu builder feature fo 9. [πΈοΈ Public API specification](#%EF%B8%8F-public-api-specification) - [REST API](#rest-api) - [GraphQL API](#graphql-api) -10. [π¬ FAQ](#-faq) -11. [π€ Contributing](#-contributing) -12. [π¨βπ» Community support](#-community-support) +10. [π Extensions](#-extensions) +11. [𧩠Examples](#-examples) +12. [π¬ FAQ](#-faq) +13. [π€ Contributing](#-contributing) +14. [π¨βπ» Community support](#-community-support) ## β¨ Features @@ -184,7 +186,6 @@ Config for this plugin is stored as a part of the `config/plugins.js` or `config - `gql` - If you're using GraphQL that's the right place to put all necessary settings. More **[ here ](#gql-configuration)** - `i18nEnabled` - should you want to manage multi-locale content via navigation set this value `Enabled`. More **[ here ](#i18n-internationalization)** - `cascadeMenuAttached` - If you don't want "Menu attached" to cascade on child items set this value `Disabled`. -- `slugify` - allows to extend configuration of our "slugging" solution of choice. To learn more visit the [documentation](https://github.com/sindresorhus/slugify#api). It can be left unset since it's optional. **This option can only be handled by configuration in config file**. ### Properties @@ -638,37 +639,16 @@ For collection types it will be read from content type's attribute name `templat For single types a global name of this content type will be used as a template name or it can be set manually with an option named `templateName`. -## 𧩠Examples - -Live example of plugin usage can be found in the [VirtusLab Strapi Examples](https://github.com/VirtusLab/strapi-examples/tree/master/strapi-plugin-navigation) repository. - -## π¬ FAQ - -### GraphQL tricks - -**Q:** I would like to use GraphQL schemas but I'm not getting renderNavigation query or even proper types as Navigation, NavigationItem etc. What should I do? - -**A:** **A:** There is a one trick you might try. Strapi by default is ordering plugins by the way which takes `strapi-plugin-graphql` to initialize earlier than other plugins so types might not be injected. If you don't have it yet, please create `config/plugins.js` file and put there following lines (put `graphql` at the end): - -```js -module.exports = { - 'navigation': { enabled: true }, - 'graphql': { enabled: true }, -}; -``` - -If you already got it, make sure that `navigation` plugin is inserted before `graphql`. That should do the job. +## π Extensions ### Slug generation -#### Customisation - Slug generation is available as a controller and service. If you have custom requirements outside of what this plugin provides you can add your own logic with [plugins extensions](https://docs.strapi.io/developer-docs/latest/development/plugins-extension.html). For example: ```ts -// path: ./src/index.js +// path: /admin/src/index.js module.exports = { // ... @@ -686,6 +666,27 @@ module.exports = { }; ``` +## 𧩠Examples + +Live example of plugin usage can be found in the [VirtusLab Strapi Examples](https://github.com/VirtusLab/strapi-examples/tree/master/strapi-plugin-navigation) repository. + +## π¬ FAQ + +### GraphQL tricks + +**Q:** I would like to use GraphQL schemas but I'm not getting renderNavigation query or even proper types as Navigation, NavigationItem etc. What should I do? + +**A:** **A:** There is a one trick you might try. Strapi by default is ordering plugins by the way which takes `strapi-plugin-graphql` to initialize earlier than other plugins so types might not be injected. If you don't have it yet, please create `config/plugins.js` file and put there following lines (put `graphql` at the end): + +```js +module.exports = { + 'navigation': { enabled: true }, + 'graphql': { enabled: true }, +}; +``` + +If you already got it, make sure that `navigation` plugin is inserted before `graphql`. That should do the job. + ## π€ Contributing